/* BeneCloud Webapp — hell, modern, viel Animation, mobile-first. */

:root {
  --bg:            #ffffff;
  --bg-soft:       #f5f8ff;
  --bg-elevated:   #ffffff;
  --fg:            #0e1420;
  --fg-muted:      #5c6879;
  --fg-faint:      #9aa4b4;
  --border:        #e6ecf5;
  --border-strong: #c9d4e5;
  --accent:        #5b7cff;
  --accent-dark:   #3f5fe3;
  --accent-ghost:  #ecf1ff;
  --accent-ring:   rgba(91, 124, 255, .18);
  --accent-grad:   linear-gradient(135deg, #5b7cff 0%, #a06bff 100%);
  --danger:        #e23b4b;
  --success:       #1aa66b;
  --shadow-sm:     0 1px 3px rgba(20, 30, 60, .06);
  --shadow-md:     0 10px 30px rgba(20, 30, 60, .08), 0 2px 8px rgba(20, 30, 60, .04);
  --shadow-lg:     0 25px 50px rgba(20, 30, 60, .1), 0 10px 20px rgba(20, 30, 60, .06);
  --radius-lg:     20px;
  --radius-md:     12px;
  --radius-sm:     8px;
  --font:          "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --ease:          cubic-bezier(.4, 0, .2, 1);
  --ease-bounce:   cubic-bezier(.34, 1.56, .64, 1);
}

[data-theme="dark"] {
  --bg:            #0b1020;
  --bg-soft:       #0e1428;
  --bg-elevated:   #141a2b;
  --fg:            #eef1f8;
  --fg-muted:      #a3adbf;
  --fg-faint:      #6c7689;
  --border:        #212a40;
  --border-strong: #2d3853;
  --accent:        #7a9bff;
  --accent-dark:   #5b7cff;
  --accent-ghost:  rgba(91, 124, 255, .15);
  --accent-ring:   rgba(91, 124, 255, .25);
  --shadow-md:     0 20px 40px rgba(0, 0, 0, .4), 0 4px 10px rgba(0, 0, 0, .3);
  --shadow-lg:     0 30px 60px rgba(0, 0, 0, .5), 0 15px 30px rgba(0, 0, 0, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  transition: background .3s var(--ease), color .3s var(--ease);
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; transition: color .2s var(--ease); }
a:hover { color: var(--accent-dark); }

/* ─── Animierter Hintergrund-Blob ─── */

.bg-blobs {
  position: fixed; inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: -1;
}
.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: .35;
  animation: float 20s ease-in-out infinite;
}
.blob-1 {
  width: 500px; height: 500px;
  background: linear-gradient(135deg, #5b7cff, #a06bff);
  top: -150px; left: -150px;
}
.blob-2 {
  width: 400px; height: 400px;
  background: linear-gradient(135deg, #ff8bbf, #ffb66b);
  bottom: -100px; right: -100px;
  animation-delay: -5s;
  animation-duration: 25s;
}
.blob-3 {
  width: 300px; height: 300px;
  background: linear-gradient(135deg, #6bffbf, #5b7cff);
  top: 50%; left: 60%;
  animation-delay: -10s;
  animation-duration: 30s;
  opacity: .25;
}
[data-theme="dark"] .blob { opacity: .18; }

@keyframes float {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(60px, -40px) scale(1.1); }
  66%      { transform: translate(-40px, 60px) scale(.95); }
}

/* ─── Brand ─── */

.brand {
  margin: 0;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: -.03em;
  background: var(--accent-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
[data-theme="dark"] .brand { filter: brightness(1.2); }

/* ─── Theme-Toggle ─── */

.theme-toggle {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--fg);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform .3s var(--ease-bounce), background .25s var(--ease);
  z-index: 50;
}
.theme-toggle:hover { transform: translateY(-3px) rotate(15deg); }
.theme-toggle.inline { position: static; width: 42px; height: 42px; box-shadow: var(--shadow-sm); }
.theme-toggle svg { width: 20px; height: 20px; transition: transform .4s var(--ease-bounce); }
.theme-toggle:hover svg { transform: scale(1.1); }
[data-theme="light"] .theme-icon-moon { display: none; }
[data-theme="dark"]  .theme-icon-sun  { display: none; }

/* ──────────────────────────────────────────────── */
/* Login-Seite                                       */
/* ──────────────────────────────────────────────── */

.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.auth-link {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--fg-muted);
  text-align: center;
}
.auth-link a {
  color: var(--fg-muted);
  text-decoration: underline;
  transition: color .18s var(--ease);
}
.auth-link a:hover { color: var(--accent); }

/* ─ Rail + Slider-Panel ─
   Breiter Balken (Rail) mit Gradient-Hintergrund; darauf sitzt EIN kompaktes
   Form-Panel das horizontal zwischen zwei Positionen slidet.
   Links/rechts in der Rail stehen die Call-to-Actions, die jeweils vom
   Panel verdeckt werden. */

.auth-rail {
  position: relative;
  width: min(900px, 100%);
  min-height: 640px;
  background: var(--accent-grad);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  animation: cardIn .6s var(--ease-bounce);
}
.auth-rail::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 25%, rgba(255,255,255,.18), transparent 50%),
    radial-gradient(circle at 85% 75%, rgba(255,255,255,.14), transparent 55%);
  pointer-events: none;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(30px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Die beiden Rail-Seiten: jeweils 50% breit, zeigen Branding + CTA.
   Nur eine Seite ist sichtbar, die andere wird vom Form-Panel verdeckt. */
.rail-side {
  flex: 0 0 50%;
  padding: 60px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
  color: white;
  position: relative;
  z-index: 1;
}
.rail-side .brand {
  background: linear-gradient(135deg, #ffffff, #d5deff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin: 0;
  font-size: 32px;
}
.rail-side .brand-accent { color: inherit; }
.rail-side p {
  margin: 0;
  max-width: 300px;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(255, 255, 255, .92);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, .75);
  padding: 11px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  letter-spacing: .02em;
  transition: background .25s var(--ease), border-color .25s var(--ease), transform .18s var(--ease);
  pointer-events: auto;
}
.btn-outline:hover {
  background: rgba(255, 255, 255, .18);
  border-color: white;
  transform: translateY(-2px);
}
.btn-outline:active { transform: translateY(0); }

/* Das weiße Form-Panel liegt oben drauf — slidet horizontal.
   Innen ein doppelt-breiter Rail der die beiden Formulare nebeneinander
   trägt und gegensätzlich slidet, damit immer das richtige Formular im
   Panel sichtbar ist. */
.form-slider {
  position: absolute;
  top: 20px;
  left: 20px;
  width: calc(50% - 40px);
  height: calc(100% - 40px);
  background: var(--bg-elevated);
  border-radius: var(--radius-md);
  box-shadow:
    0 25px 60px rgba(10, 20, 50, .35),
    0 10px 20px rgba(10, 20, 50, .18);
  overflow: hidden;
  z-index: 10;
  /* GPU-Beschleunigung erzwingen für smooth slide */
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform .7s cubic-bezier(.65, .05, .36, 1);
}
.auth-rail.register-mode .form-slider {
  transform: translate3d(calc(100% + 40px), 0, 0);
}

.form-slider-inner {
  display: flex;
  width: 200%;
  height: 100%;
  will-change: transform;
  transform: translate3d(0, 0, 0);
  transition: transform .7s cubic-bezier(.65, .05, .36, 1);
}
.auth-rail.register-mode .form-slider-inner {
  transform: translate3d(-50%, 0, 0);
}

.form-slider .auth-form {
  flex: 0 0 50%;
  width: 50%;
  height: 100%;
  padding: 36px 36px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;        /* Register-Form hat viele Felder — scrollen erlauben */
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.auth-form-inner {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: auto 0;  /* vertikal zentriert, auch wenn Content kurz */
}
/* Field-Reveal nur beim initialen Page-Load (via body.loaded Flag im JS).
   Nach Toggle/Slide KEINE Field-Animation — der Slide allein ist genug
   Bewegung, Content bleibt stabil, kein Flash. */
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > * {
  animation: fieldIn .5s cubic-bezier(.4, 0, .2, 1) backwards;
}
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(1) { animation-delay: .08s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(2) { animation-delay: .14s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(3) { animation-delay: .18s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(4) { animation-delay: .22s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(5) { animation-delay: .26s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(6) { animation-delay: .30s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(7) { animation-delay: .34s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(8) { animation-delay: .38s; }
.auth-body:not(.loaded) .form-slider .auth-form.active .auth-form-inner > *:nth-child(9) { animation-delay: .42s; }

@keyframes fieldIn {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

.form-slider h2 {
  margin: 0 0 2px;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.form-slider .muted.small { margin: 0 0 12px; }
.form-slider code {
  background: var(--bg-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
}

/* Floating-Label Field */
.field {
  position: relative;
}
.field input, .field textarea, .field select {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 18px 14px 10px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  transition: border-color .2s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.field label {
  position: absolute;
  top: 15px;
  left: 14px;
  font-size: 14px;
  color: var(--fg-faint);
  pointer-events: none;
  transition: top .2s var(--ease), font-size .2s var(--ease), color .2s var(--ease);
  background: transparent;
  padding: 0 2px;
}
.field input:focus ~ label,
.field input:not(:placeholder-shown) ~ label,
.field textarea:focus ~ label,
.field textarea:not(:placeholder-shown) ~ label,
.field select:focus ~ label,
.field select:valid ~ label {
  top: 4px;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.field label .hint {
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-faint);
  font-weight: 400;
  margin-left: 6px;
}
.field textarea { padding-top: 24px; min-height: 110px; resize: vertical; }

/* Primary-Button mit Spinner */
.btn-primary {
  position: relative;
  background: var(--accent-grad);
  color: white;
  border: none;
  padding: 13px 18px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .15s var(--ease), box-shadow .2s var(--ease);
  box-shadow: 0 8px 20px var(--accent-ring);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--accent-ring); }
.btn-primary:active { transform: translateY(0); }
.btn-primary::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, .25), transparent);
  transform: translateX(-100%);
  transition: transform .6s var(--ease);
  z-index: -1;
}
.btn-primary:hover::before { transform: translateX(100%); }
.btn-primary .btn-spinner {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: white;
  border-radius: 50%;
  animation: spin .8s cubic-bezier(.5, .15, .5, .85) infinite;
  vertical-align: middle;
  margin-left: 10px;
  will-change: transform;
}
.btn-primary.loading .btn-spinner { display: inline-block; }
.btn-primary.loading .btn-label { opacity: .8; }
.btn-primary.loading { pointer-events: none; }
.btn-primary:disabled { opacity: .7; cursor: wait; }

.btn-ghost {
  background: transparent;
  color: var(--fg-muted);
  border: 1px solid var(--border);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.btn-ghost:hover { background: var(--accent-ghost); color: var(--accent); border-color: var(--accent); }

/* Error-Box ist komplett unsichtbar wenn leer — Border/Background nur mit Inhalt. */
.form-error { display: none; }
.form-error:not(:empty) {
  font-size: 14px;
  color: var(--danger);
  background: rgba(226, 59, 75, .08);
  border: 1px solid rgba(226, 59, 75, .25);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideUp .3s var(--ease-bounce);
}
.form-error:not(:empty)::before {
  content: '⚠';
  font-size: 18px;
  flex-shrink: 0;
}

/* Passwort-Strength ────── */

.strength {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: -8px;
}
.strength-bar {
  flex: 1;
  height: 6px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.strength-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--danger);
  border-radius: 999px;
  transition: width .25s var(--ease), background .25s var(--ease);
}
.strength-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--fg-muted);
  min-width: 50px;
  text-align: right;
}
.strength[data-level="weak"]   .strength-bar span { width: 25%; background: #e23b4b; }
.strength[data-level="fair"]   .strength-bar span { width: 50%; background: #ff9d3a; }
.strength[data-level="good"]   .strength-bar span { width: 75%; background: #f5c419; }
.strength[data-level="strong"] .strength-bar span { width: 100%; background: #1aa66b; }
.strength[data-level="weak"]   .strength-label { color: #e23b4b; }
.strength[data-level="fair"]   .strength-label { color: #ff9d3a; }
.strength[data-level="good"]   .strength-label { color: #c99900; }
.strength[data-level="strong"] .strength-label { color: #1aa66b; }

/* Settings-Tabs ────── */

.settings-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin: 0 22px;
  gap: 4px;
}
.settings-tab {
  position: relative;
  background: transparent;
  border: none;
  padding: 12px 16px;
  font: inherit;
  font-weight: 500;
  color: var(--fg-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.settings-tab:hover { color: var(--fg); }
.settings-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.settings-panel { display: none; }
.settings-panel.active { display: block; animation: fadeIn .25s var(--ease); }

.profile-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0 6px;
}

/* Avatar-Warning-Dot (wenn 2FA nicht aktiv) */
.avatar-warn {
  position: absolute;
  top: -3px; right: -3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #e23b4b;
  color: white;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-elevated);
  animation: pulseDot 1.6s infinite;
  pointer-events: none;
}
.avatar-wrap, .avatar-btn { position: relative; }

/* ── Force-2FA-Overlay (Staff ohne 2FA) ─────────────── */

.force-2fa-overlay[hidden] { display: none !important; }
.force-2fa-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 30, .85);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn .3s var(--ease);
}
.force-2fa-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 460px;
  width: 100%;
  padding: 40px 32px;
  text-align: center;
  animation: popIn .35s var(--ease-bounce);
}
.force-2fa-icon {
  font-size: 56px;
  margin-bottom: 12px;
}
.force-2fa-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}
.force-2fa-card .muted {
  margin: 0 0 20px;
  font-size: 14px;
}
.force-2fa-card .small {
  font-size: 13px;
  line-height: 1.55;
  text-align: left;
}
.force-2fa-card .btn-primary {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  margin-top: 16px;
}
.force-2fa-card code {
  background: var(--bg-soft);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: 1px;
}
.force-2fa-card .field { margin: 10px 0 0; }

/* ── Announcements / Blog ─────────────────────────────── */

.ann-admin-bar { margin-bottom: 14px; display: flex; justify-content: flex-end; }
.btn-primary-sm {
  background: var(--accent-grad); color: white; border: none;
  padding: 8px 14px; border-radius: var(--radius-sm);
  font: inherit; font-weight: 600; font-size: 13px; cursor: pointer;
  box-shadow: 0 4px 10px var(--accent-ring);
  transition: transform .18s var(--ease);
}
.btn-primary-sm:hover { transform: translateY(-1px); }

.ann-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 28px; }
.ann-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  animation: slideUp .4s var(--ease-bounce);
}
.ann-info        { border-left-color: var(--accent); }
.ann-update      { border-left-color: #22c7a1; }
.ann-warning     { border-left-color: #f5a623; background: linear-gradient(135deg, var(--bg-elevated), rgba(245, 166, 35, .05)); }
.ann-maintenance { border-left-color: var(--danger); background: linear-gradient(135deg, var(--bg-elevated), rgba(226, 59, 75, .05)); }
.ann-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; color: var(--fg-muted); }
.ann-type { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.ann-date { margin-left: auto; font-size: 11px; }
.ann-del {
  background: transparent; border: none; color: var(--fg-faint);
  cursor: pointer; font-size: 14px; padding: 2px 6px; border-radius: 4px;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.ann-del:hover { background: rgba(226, 59, 75, .1); color: var(--danger); }
.ann-card h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.ann-body { font-size: 14px; line-height: 1.55; color: var(--fg); }
.ann-img { display: block; max-width: 100%; height: auto; border-radius: var(--radius-sm); margin-top: 12px; }

/* 2FA Settings Card */
.twofa-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 12px 22px 20px;
}
.twofa-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.twofa-head h4 { margin: 0 0 4px; font-size: 15px; }
.twofa-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  white-space: nowrap;
}
.twofa-badge.active { background: rgba(26, 166, 107, .18); color: var(--success); }
.twofa-badge.warn { background: rgba(226, 59, 75, .18); color: var(--danger); }
.twofa-box .small { font-size: 13px; line-height: 1.5; }
.twofa-box code {
  background: var(--bg-elevated);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: 1px;
}
.profile-row img { border-radius: 50%; border: 2px solid var(--border); }
.profile-row strong { display: block; font-size: 16px; }
.small { font-size: 12px; }

/* ─── Tickets-SPA (eigene Views pro Typ) ─── */

.spa-main { max-width: 960px; margin: 0 auto; padding: 32px 24px 60px; }
.spa-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  font-size: 13px;
  color: var(--fg-muted);
}
.spa-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
  text-decoration: none;
  transition: background .18s var(--ease), transform .15s var(--ease);
}
.spa-nav a:hover { background: var(--accent-ghost); color: var(--accent); transform: translateX(-2px); }

/* List-View */
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.list-head h2 { margin: 0; font-size: 28px; letter-spacing: -.02em; }
.list-head .muted { margin: 2px 0 0; }
.list-actions { display: flex; align-items: center; gap: 12px; }

.status-slider {
  display: inline-flex;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px;
  gap: 2px;
}
.s-opt {
  background: transparent;
  border: none;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--fg-muted);
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.s-opt.active { background: var(--accent-grad); color: white; }

.btn-fab-lg {
  background: var(--accent-grad);
  color: white;
  border: none;
  padding: 11px 18px;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 8px 20px var(--accent-ring);
  transition: transform .18s var(--ease), box-shadow .2s var(--ease);
}
.btn-fab-lg:hover { transform: translateY(-2px); box-shadow: 0 12px 28px var(--accent-ring); }
.btn-fab-lg span:first-child { font-size: 20px; line-height: 1; }

.ticket-cards { display: flex; flex-direction: column; gap: 10px; }
.ticket-card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 18px 20px;
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: transform .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
  animation: slideUp .4s var(--ease-bounce) backwards;
}
.ticket-card:hover {
  transform: translateX(4px);
  border-color: var(--accent);
  box-shadow: 0 6px 20px var(--accent-ring);
}
.ticket-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
.ticket-card-head strong { flex: 1; font-size: 15px; }
.ticket-card .meta { font-size: 12px; color: var(--fg-faint); }
.unread-dot {
  width: 8px; height: 8px;
  background: var(--danger);
  border-radius: 50%;
  display: inline-block;
  animation: pulseDot 1.6s infinite;
  margin-right: 6px;
  vertical-align: middle;
  flex-shrink: 0;
}
/* Ticket mit neuer Antwort: Border + leicht roter Tint */
.ticket-row.has-unread,
.ticket-card.has-unread {
  border-color: var(--danger);
  background: linear-gradient(135deg, var(--bg-elevated), rgba(226, 59, 75, .04));
}
.ticket-row.has-unread strong,
.ticket-card.has-unread strong { color: var(--fg); font-weight: 700; }
@keyframes pulseDot { 50% { transform: scale(1.3); } }

.list-empty {
  background: var(--bg-elevated);
  border: 1px dashed var(--border);
  padding: 60px 24px;
  border-radius: var(--radius-md);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.list-empty-icon { font-size: 56px; opacity: .5; }
.list-empty h3 { margin: 0; font-size: 22px; }
.list-empty p { margin: 0; max-width: 420px; }

/* New-View (Vollbild-Formular) */
.big-form {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}
.field-lg {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.field-lg label {
  font-size: 13px;
  font-weight: 700;
  color: var(--fg);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.field-lg input, .field-lg select, .field-lg textarea {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 14px 16px;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-family: inherit;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  width: 100%;
  box-sizing: border-box;
}
.field-lg select {
  height: 52px;
  /* Native appearance killen damit Border-Radius und Höhe konsistent mit Inputs sind */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--fg-muted) 50%),
    linear-gradient(135deg, var(--fg-muted) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.field-row .field-lg { min-width: 0; }
.field-lg textarea { min-height: 180px; resize: vertical; line-height: 1.5; }
.field-lg input:focus, .field-lg select:focus, .field-lg textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
  background: var(--bg-elevated);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.btn-primary-lg { padding: 14px 24px; font-size: 15px; }

.hint {
  text-transform: none;
  letter-spacing: 0;
  color: var(--fg-faint);
  font-weight: 400;
  font-size: 12px;
  margin-left: 6px;
}

.attach-dropzone {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-soft);
  border: 2px dashed var(--border-strong);
  color: var(--fg-muted);
  padding: 16px 22px;
  border-radius: var(--radius-md);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), background .2s var(--ease);
  width: fit-content;
}
.attach-dropzone:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-ghost);
}

.upload-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.upload-row {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .25s var(--ease);
}
.upload-row[data-status="done"] { border-color: var(--success); }
.upload-row[data-status="error"] { border-color: var(--danger); }
.upload-head {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 6px;
}
.upload-head strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-size { color: var(--fg-faint); font-size: 11px; }
.upload-bar {
  height: 4px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.upload-bar span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--accent-grad);
  border-radius: 999px;
  transition: width .18s linear;
}
.upload-row[data-status="done"] .upload-bar span { background: var(--success); }
.upload-row[data-status="error"] .upload-bar span { background: var(--danger); }
/* Queued: keine Progress-Bar (wartet auf Submit) — nur ein Hinweistext */
.upload-row[data-status="queued"] .upload-bar { display: none; }
.upload-row[data-status="queued"] { background: var(--bg-elevated); }
.upload-queued-hint {
  font-size: 11px;
  color: var(--fg-faint);
  margin-left: auto;
}

.upload-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  background: var(--success);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  font-weight: 700;
  animation: popIn .25s var(--ease-bounce);
}
.upload-err {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  background: var(--danger);
  color: white;
  border-radius: 50%;
  font-size: 11px;
}
.upload-spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s cubic-bezier(.5, .15, .5, .85) infinite;
  will-change: transform;
}
@keyframes popIn {
  from { opacity: 0; transform: scale(.5); }
  to   { opacity: 1; transform: scale(1); }
}
.upload-remove {
  background: transparent;
  border: none;
  color: var(--fg-faint);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
}
.upload-remove:hover { color: var(--danger); }

/* HTML-hidden-Attribut hart erzwingen UND Pointer-Events deaktivieren, damit
   versteckte Overlays niemals Clicks fangen können. */
[hidden] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
.spa-view[hidden],
#viewChat[hidden],
#viewList[hidden],
#viewNew[hidden] { display: none !important; }

/* Chat-View (eigene Seite statt Modal) */
#viewChat { display: flex; flex-direction: column; min-height: calc(100vh - 180px); }
.chat-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}
.chat-head h2 { margin: 0 0 6px; font-size: 22px; letter-spacing: -.015em; }
.chat-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-muted); flex-wrap: wrap; }
.chat-owner { font-weight: 500; }
.chat-actions { display: flex; align-items: center; gap: 10px; }
.status-select {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* Unban-Panel bei Staff-Chats */
.unban-panel {
  margin: 16px 0;
  padding: 18px 20px;
  background: linear-gradient(135deg, rgba(226, 59, 75, .06), rgba(91, 124, 255, .04));
  border: 1px solid rgba(226, 59, 75, .25);
  border-radius: var(--radius-md);
}
.unban-summary { font-size: 14px; margin-bottom: 10px; }
.active-ban { background: var(--bg-elevated); padding: 14px 16px; border-radius: var(--radius-sm); margin-top: 10px; }
.active-ban h4 { margin: 0 0 8px; font-size: 14px; }
.active-ban > div { font-size: 13px; margin-bottom: 4px; }
.ban-actions { display: flex; gap: 10px; margin-top: 12px; }
.history-details { margin-top: 10px; font-size: 13px; }
.history-details ul { margin: 8px 0 0 20px; padding: 0; }
.history-details li { margin-bottom: 4px; }
.chat-log { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; max-height: 240px; overflow-y: auto; background: var(--bg-elevated); padding: 10px 14px; border-radius: var(--radius-sm); margin: 8px 0 0; }
.chat-log li { margin-bottom: 2px; list-style: none; }
.btn-ghost.small { font-size: 11px; padding: 2px 8px; }

/* Sanctions-Seite */
.search-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.search-row input[type=search] { flex: 1; min-width: 240px; padding: 9px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); color: inherit; }
.search-row select { padding: 9px 32px 9px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-elevated); color: inherit; font: inherit; cursor: pointer; appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'><path fill='%23a1a1aa' d='M0 0l5 6 5-6z'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; background-size: 10px; }
.search-row .checkbox-row { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: var(--radius-sm); background: var(--bg-elevated); cursor: pointer; user-select: none; }
.search-row .checkbox-row input[type=checkbox] { accent-color: #6366f1; width: 16px; height: 16px; cursor: pointer; }
.doc-status { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; font-weight: 700; font-size: 15px; flex-shrink: 0; }
.doc-status.green  { background: #166534; color: #bbf7d0; }
.doc-status.yellow { background: #a16207; color: #fef3c7; }
.doc-status.red    { background: #991b1b; color: #fecaca; }

/* Beschluss-Block (prominent oben in Entbannungsanträgen) */
.decision-doc { border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 16px 20px; margin-bottom: 14px; background: var(--bg-elevated); }
.decision-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin-bottom: 10px; }
.decision-verdict { font-size: 20px; font-weight: 800; text-align: center; padding: 14px; border: 2px dashed; margin: 10px 0; text-transform: uppercase; letter-spacing: 1px; }
.decision-verdict.verdict-accepted  { color: #166534; border-color: #166534; background: #dcfce7; }
.decision-verdict.verdict-rejected  { color: #991b1b; border-color: #991b1b; background: #fee2e2; }
.decision-verdict.verdict-shortened { color: #92400e; border-color: #92400e; background: #fef3c7; }
[data-theme="dark"] .decision-verdict.verdict-accepted  { background: #064e3b; color: #bbf7d0; }
[data-theme="dark"] .decision-verdict.verdict-rejected  { background: #450a0a; color: #fecaca; }
[data-theme="dark"] .decision-verdict.verdict-shortened { background: #431407; color: #fef3c7; }
.decision-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.decision-pdf-btn {
  display: flex; align-items: center; gap: 16px;
  margin: 16px 0; padding: 16px 20px;
  background: #111; color: #fff; text-decoration: none;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  transition: transform .15s, box-shadow .15s;
}
.decision-pdf-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,.3); background: #000; }
.decision-pdf-icon { font-size: 28px; }
.decision-pdf-btn strong { display: block; font-size: 15px; margin-bottom: 2px; }
.decision-pdf-btn small { display: block; font-size: 12px; opacity: .75; }
.decision-pdf-arrow { margin-left: auto; font-size: 20px; opacity: .7; }
[data-theme="dark"] .decision-pdf-btn { background: #1e293b; }
[data-theme="dark"] .decision-pdf-btn:hover { background: #334155; }
.btn-success { background: #166534; color: #fff; border: 0; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; }
.btn-success:hover { background: #15803d; }
.btn-warning { background: #a16207; color: #fff; border: 0; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; }
.btn-warning:hover { background: #ca8a04; }
.btn-danger { background: #991b1b; color: #fff; border: 0; padding: 8px 14px; border-radius: var(--radius-sm); cursor: pointer; font: inherit; }
.btn-danger:hover { background: #b91c1c; }
.btn-danger.is-locked, .btn-warning.is-locked, .btn-primary.is-locked { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.4); }
.btn-danger.is-locked:hover, .btn-warning.is-locked:hover, .btn-primary.is-locked:hover { transform: none; box-shadow: none; }
.sanction-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--bg-elevated); }
.sanction-main { flex: 1; }
.sanction-head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.sanction-id { font-weight: 700; font-size: 16px; color: var(--text-muted, #a1a1aa); padding: 2px 8px; border-radius: var(--radius-sm); background: var(--bg-elevated); }
.sanction-replay { margin-top: 6px; font-size: 12px; display: flex; gap: 8px; align-items: center; }
.sanction-until { margin-top: 6px; font-size: 13px; }
.sanction-until strong { font-weight: 700; }
.signature-box { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 18px 20px; margin-bottom: 18px; background: var(--bg-elevated); }
.signature-box .twofa-head { margin-bottom: 10px; }
#signaturePreviewWrap, #signatureCanvasWrap { margin: 12px 0; }
.signature-preview { max-width: 100%; width: auto; max-height: 90px; height: auto; background: #fff; border: 1px solid var(--border); border-radius: 4px; padding: 8px 12px; display: block; margin: 0 auto; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.signature-canvas { max-width: 100%; width: 100%; height: 140px; background: #fff; border: 1px solid var(--border); border-radius: 4px; cursor: crosshair; display: block; touch-action: none; margin: 0 auto; }
.signature-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; justify-content: flex-end; }
.btn-primary.small, .btn-ghost.small { padding: 6px 14px; font-size: 12px; }
.twofa-badge.ok   { background: #166534; color: #bbf7d0; }
.twofa-badge.warn { background: #a16207; color: #fef3c7; }

.sanction-row { cursor: pointer; transition: background .12s; }
.sanction-row:hover { background: var(--bg-soft, rgba(255,255,255,.03)); }
.sanction-chevron { font-size: 16px; opacity: .5; margin-left: 10px; }
.sanction-row-wrap { margin-bottom: 10px; }
.sanction-detail { padding: 16px 20px; border: 1px solid var(--border); border-top: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--bg-elevated); font-size: 13px; }
.sanction-detail > .detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.sanction-detail section { padding: 12px; background: rgba(255,255,255,.02); border-radius: var(--radius-sm); }
.sanction-detail section > strong { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 700; }
.sanction-detail .detail-text { font-size: 12px; opacity: .85; }
.sanction-detail .detail-subsection { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--border); }
.sanction-detail .detail-subsection > strong { display: block; margin-bottom: 4px; font-size: 13px; font-weight: 700; }
.sanction-detail section.detail-full { grid-column: 1 / -1; }
.sanction-detail .evidence-grid { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); }
.sanction-detail .evidence-item { aspect-ratio: 1 / 1; }
.sanction-detail .chat-log { max-height: 200px; }
@media (max-width: 700px) { .sanction-detail > .detail-grid { grid-template-columns: 1fr; } }
.sanction-replay code { background: var(--bg-elevated); padding: 2px 6px; border-radius: 4px; }
.sanction-reason { font-size: 13px; margin: 4px 0; }
.sanction-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }
.badge-warn { background: #a16207; color: #fff; }

/* Dropzone + Evidence */
.dropzone { border: 2px dashed var(--border); padding: 24px; text-align: center; border-radius: var(--radius-sm); cursor: pointer; transition: border-color .15s; }
.dropzone.drag-over { border-color: #22c55e; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 12px; }
.evidence-item { position: relative; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; background: var(--bg-elevated); }
.evidence-item img, .evidence-item video { width: 100%; height: 100%; object-fit: cover; }
.evidence-doc { text-align: center; padding: 10px; font-size: 11px; word-break: break-all; }
.evidence-pending { font-size: 12px; color: var(--text-muted); }
.evidence-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border-radius: 50%; background: rgba(0,0,0,.7); color: #fff; border: 0; cursor: pointer; font-size: 14px; }
.autocomplete-list { position: relative; }
.autocomplete-item { padding: 8px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.autocomplete-item:hover { background: var(--bg-elevated); }
.modal-wide { max-width: 820px; }

/* Embed-Mode (sanctions.html in iframe): Nur das Sanctions-Modal zeigen, keine Headers, kein Hintergrund. */
html.embed-mode body { background: transparent !important; }
html.embed-mode body > header,
html.embed-mode body > main > section:not(.spa-view-noop),
html.embed-mode body > main > .spa-view,
html.embed-mode body .topbar,
html.embed-mode body .toast-container { display: none !important; }
html.embed-mode body #sanctionModal { position: static; animation: none; backdrop-filter: none; background: transparent; }
html.embed-mode body #sanctionModal .modal { animation: none; margin: 0 auto; }

#viewChat .chat-messages {
  flex: 1;
  min-height: 300px;
  margin: 18px 0;
  padding: 20px;
  background: var(--bg-soft);
  border-radius: var(--radius-md);
}
#viewChat .chat-composer {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 20px;
}

/* Staff-Section auf Dashboard */
.staff-section { margin-top: 40px; animation: slideUp .5s var(--ease-bounce) .2s both; }
.staff-section h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; }
.role-pill {
  background: var(--accent-grad);
  color: white;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
}
.role-pill[data-role="moderator"] { background: linear-gradient(135deg, #ff8b4a, #e23b4b); }
.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}
.staff-card {
  display: block;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 22px 20px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: transform .2s var(--ease-bounce), border-color .18s var(--ease), box-shadow .18s var(--ease);
  position: relative;  /* Anker für .card-badges */
}
.staff-card:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 15px 30px var(--accent-ring); }
.staff-card h3 { margin: 6px 0 2px; font-size: 16px; }
.staff-card p { margin: 0; font-size: 12px; color: var(--fg-muted); }

/* Random-Card: dezenter Akzent damit sie sich von normalen Staff-Cards abhebt. */
.staff-card-random {
  background: linear-gradient(135deg, var(--bg-elevated), var(--accent-ghost, rgba(90,140,220,.08)));
  border-color: var(--accent-dark, #4a7fcd);
}
.staff-card-random:hover {
  border-color: var(--accent, #6b9cde);
  box-shadow: 0 15px 30px rgba(90,140,220,.25);
}

/* Notification-Badges oben rechts auf Staff-Karten (wie Handy-App). */
.card-badges {
  position: absolute; top: 10px; right: 10px;
  display: flex; gap: 6px;
}
.card-badge {
  min-width: 22px; height: 22px; padding: 0 7px;
  border-radius: 11px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: white;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.card-badge-open { background: #d4493a; }
.card-badge-wait { background: #e8b020; color: #3a2800; }
.staff-recent-title { font-size: 15px; margin: 0 0 10px; color: var(--fg-muted); }

/* alte .tickets-layout bleibt für Kompat als no-op */
.tickets-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  padding: 24px;
  max-width: 1280px;
  margin: 0 auto;
  min-height: calc(100vh - 72px);
}

.tickets-sidebar {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.tickets-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.t-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--fg-muted);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.t-tab:hover { background: var(--bg-soft); color: var(--fg); }
.t-tab.active { background: var(--accent); color: white; }

.btn-fab {
  margin: 12px;
  background: var(--accent-grad);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 16px var(--accent-ring);
  transition: transform .18s var(--ease), box-shadow .2s var(--ease);
}
.btn-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 20px var(--accent-ring); }
.btn-fab span { font-size: 20px; line-height: 1; }

.tickets-list {
  overflow-y: auto;
  flex: 1;
  padding: 0 8px 8px;
}
.ticket-item {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  margin-bottom: 4px;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}
.ticket-item:hover { background: var(--bg-soft); }
.ticket-item.active {
  background: var(--accent-ghost);
  border-color: var(--accent);
}
.ticket-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.ticket-item-top strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.ticket-item-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--fg-faint); }

/* ─── Chat-Hauptbereich ─── */

.tickets-main {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.chat-empty {
  margin: auto;
  text-align: center;
  padding: 60px 20px;
}
.chat-empty .empty-emoji { font-size: 56px; margin-bottom: 10px; opacity: .6; }
.chat-empty h3 { margin: 0 0 6px; font-size: 20px; }

.chat-view { display: flex; flex-direction: column; height: 100%; }
.chat-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.chat-head h3 { margin: 0 0 4px; font-size: 18px; }
.chat-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--fg-muted); }
.chat-type { font-weight: 500; }

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--bg-soft);
  scroll-behavior: smooth;
}
.chat-bubble {
  max-width: 72%;
  padding: 10px 14px;
  border-radius: 14px;
  position: relative;
}
/* Nur neu appendete bubbles animieren (via JS appendChild → :last-child-Ketten greifen).
   Beim full-render erscheinen alle Bubbles instant, keine Welle. */
.chat-messages .chat-bubble { animation: none; }
.chat-messages .chat-bubble:last-child { animation: bubbleIn .3s var(--ease); }
@keyframes bubbleIn {
  from { opacity: 0; transform: translate3d(0, 6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}
.chat-bubble.user {
  background: var(--accent-grad);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.chat-bubble.staff {
  background: var(--bg-elevated);
  color: var(--fg);
  align-self: flex-start;
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}
.bubble-text { font-size: 14px; line-height: 1.5; word-wrap: break-word; }
.bubble-meta {
  font-size: 10px;
  margin-top: 4px;
  opacity: .75;
  text-align: right;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.chat-bubble.staff .bubble-meta { text-align: left; }

/* Original-Ticket als eigenständige Karte oben im Chat (keine Message-Bubble) */
.original-ticket {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  max-width: 760px;
  margin: 0 auto 18px;
  box-shadow: var(--shadow-sm);
  animation: slideUp .4s var(--ease-bounce);
}
.orig-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.orig-icon { font-size: 32px; }
.orig-head > div { flex: 1; min-width: 0; }
.orig-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 2px;
}
.orig-subject {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.015em;
  color: var(--fg);
}
.orig-date {
  font-size: 11px;
  color: var(--fg-muted);
  white-space: nowrap;
}
.orig-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 14px;
  color: var(--fg-faint);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .1em;
  font-weight: 600;
}
.orig-divider::before,
.orig-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.orig-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.orig-field {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}
.orig-field-key {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--accent);
}
.orig-field-value {
  font-size: 14px;
  line-height: 1.55;
  color: var(--fg);
  white-space: pre-wrap;
  word-break: break-word;
}
.orig-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.orig-attachments .attach-image {
  max-width: 220px;
  max-height: 220px;
}
.orig-attachments .attach-file {
  background: var(--bg-soft);
  color: var(--fg);
}
@media (min-width: 760px) {
  /* Bei einfachen Feldern (short-value) in 2 Spalten */
  .orig-fields { grid-template-columns: repeat(2, 1fr); }
  /* Lange Textarea-Antworten sollen volle Breite nehmen → als Fallback einfach alles volle Breite:
     wir machen das Grid dennoch 1-column default und nur für knappe Werte 2 cols — pragmatisch:
     lässt sich am besten über eine Pseudo-Klasse per JS lösen; für jetzt bleibt es 1 Spalte. */
  .orig-fields { grid-template-columns: 1fr; }
}

.bubble-attachments { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.attach-image {
  display: block;
  border-radius: 10px;
  overflow: hidden;
  max-width: 220px;
  max-height: 220px;
  border: 1px solid rgba(0, 0, 0, .1);
}
.attach-image img { width: 100%; height: auto; display: block; }
.attach-file {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, .08);
  border-radius: 10px;
  font-size: 13px;
  text-decoration: none;
  color: inherit;
}
.chat-bubble.user .attach-file { background: rgba(255, 255, 255, .25); }
.attach-file small { opacity: .7; margin-left: auto; }

/* Composer */
.chat-composer {
  border-top: 1px solid var(--border);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-elevated);
}
.chat-attachments { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  padding: 4px 10px 4px 4px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 14px;
  font-size: 12px;
  min-width: 160px;
  transition: border-color .25s var(--ease);
}
.attach-chip[data-status="done"] { border-color: var(--success); }
.attach-chip[data-status="error"] { border-color: var(--danger); }
.attach-chip .chip-row { display: flex; align-items: center; gap: 6px; }
.attach-chip img { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; }
.attach-mini-icon { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.attach-chip-name { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.attach-chip-remove {
  background: transparent;
  border: none;
  color: var(--fg-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 4px;
}
.attach-chip-remove:hover { color: var(--danger); }
.chip-progress {
  height: 3px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 6px 2px;
}
.chip-progress span {
  display: block;
  height: 100%;
  background: var(--accent-grad);
  border-radius: 999px;
  width: 0%;
  transition: width .18s linear;
}

.chat-input-row { display: flex; align-items: flex-end; gap: 8px; }
.chat-attach-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.chat-attach-btn:hover { color: var(--accent); border-color: var(--accent); }
.chat-input-row textarea {
  flex: 1;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  resize: none;
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
  min-height: 42px;
  line-height: 1.4;
}
.chat-input-row textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.chat-send-btn {
  width: 44px; height: 44px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Type-Picker im Neu-Modal */
.type-picker {
  padding: 16px 20px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}
.type-btn {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 20px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font: inherit;
  color: inherit;
  animation: slideUp .4s var(--ease-bounce) var(--delay, 0ms) both;
  transition: transform .2s var(--ease-bounce), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.type-btn:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 20px var(--accent-ring);
}
.type-btn.disabled { opacity: .4; cursor: not-allowed; }
.type-btn.disabled:hover { transform: none; border-color: var(--border); box-shadow: none; }
.type-icon { font-size: 32px; }

@media (max-width: 760px) {
  .tickets-layout {
    grid-template-columns: 1fr;
    padding: 16px;
  }
  .tickets-sidebar { max-height: 320px; }
  .chat-bubble { max-width: 85%; }
}

/* Action-Card disabled (Unban wenn nicht gebannt) */
.action-card:disabled, .action-card.disabled {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: auto;
}
.action-card.disabled:hover {
  transform: none;
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.action-card.disabled:hover::before { opacity: 0; }
.action-card.disabled:hover .action-icon { transform: none; }
.action-card .locked-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--fg-muted);
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Verify-Screen: ersetzt das Formular komplett sobald der Code da ist.
   .verify-active greift auf .auth-form (direkte children) UND .auth-form-inner
   (im Slider-Markup liegt die verify-box dort drin). */
.auth-form.verify-active > *:not(.verify-box),
.auth-form.verify-active .auth-form-inner > *:not(.verify-box) { display: none; }
.auth-form.verify-active { justify-content: center; }
.auth-form.verify-active .auth-form-inner { display: flex; flex-direction: column; justify-content: center; }
.auth-form.verify-active .verify-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 24px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  animation: slideUp .4s var(--ease);
  margin: auto 0;
}

.verify-box { margin-top: 20px; }
.verify-head {
  margin: 0;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--fg-muted);
  font-weight: 700;
}
.verify-code {
  display: inline-block;
  padding: 14px 24px;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 8px;
  background: #ffffff;
  border: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  color: var(--accent);
  box-shadow: 0 8px 24px var(--accent-ring);
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
[data-theme="dark"] .verify-code { background: #0f1424; }
.verify-hint { margin: 0; font-size: 13px; color: var(--fg-muted); }
.verify-cmd, code.verify-cmd {
  display: inline-block !important;
  padding: 10px 18px !important;
  background: #1a2033 !important;
  background-color: #1a2033 !important;
  color: #ffffff !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid #2d3550 !important;
  font-family: ui-monospace, Menlo, Consolas, monospace !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  letter-spacing: .02em !important;
  cursor: pointer;
  user-select: all;
  transition: background .2s var(--ease), transform .15s var(--ease);
  text-decoration: none !important;
}
.verify-cmd:hover, code.verify-cmd:hover { background: #272e45 !important; transform: translateY(-1px); }
.verify-status {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--fg-muted);
}
.dot-flow {
  display: inline-flex;
  gap: 4px;
}
.dot-flow span {
  width: 6px; height: 6px;
  background: var(--accent);
  border-radius: 50%;
  animation: dot-pulse 1.4s cubic-bezier(.4, 0, .2, 1) infinite;
  will-change: transform, opacity;
}
.dot-flow span:nth-child(2) { animation-delay: .2s; }
.dot-flow span:nth-child(3) { animation-delay: .4s; }

@keyframes dot-pulse {
  0%, 60%, 100% { opacity: .3; transform: scale(.8); }
  30%           { opacity: 1;  transform: scale(1.1); }
}

/* ──────────────────────────────────────────────── */
/* Dashboard                                         */
/* ──────────────────────────────────────────────── */

.app-body { padding-bottom: 60px; }

.app-header {
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
[data-theme="dark"] .app-header { background: rgba(20, 26, 43, .85); }

.app-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}
.app-header .brand { font-size: 24px; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.avatar-wrap { position: relative; }
.avatar-btn {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 2px;
  cursor: pointer;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s var(--ease-bounce), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.avatar-btn:hover { transform: scale(1.05); border-color: var(--accent); box-shadow: 0 4px 12px var(--accent-ring); }
.avatar-btn img { border-radius: 50%; display: block; }

.avatar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  animation: menuIn .25s var(--ease-bounce);
  z-index: 20;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(-6px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.avatar-menu-head { padding: 12px 14px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--fg);
  border: none;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.menu-item:hover { background: var(--accent-ghost); color: var(--accent); }
.menu-warn {
  display: inline-block;
  min-width: 18px; height: 18px; line-height: 18px;
  border-radius: 50%;
  background: #e23b4b;
  color: white;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  margin-left: 8px;
  padding: 0 5px;
  animation: pulseDot 1.6s infinite;
}
.menu-warn[hidden] { display: none !important; }

.app-main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 36px 24px;
}

/* Content erst sichtbar wenn alle API-Daten (Me + Announcements) geladen sind.
   Verhindert Layout-Shifts: ohne das würde die Seite erst nur Header + action-grid
   zeigen, dann Staff-Section expandieren, dann Announcements-Skeleton → real content.
   NUR auf Dashboard — andere SPAs (tickets, staff) setzen kein body.loaded. */
.app-body[data-page="dashboard"]:not(.loaded) .app-main { opacity: 0; }
.app-body[data-page="dashboard"].loaded .app-main { opacity: 1; transition: opacity .2s ease; }

/* Staggered reveal für Sections nach .loaded. Jede Section fade-up mit kleinem Offset. */
@keyframes section-reveal {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.app-body[data-page="dashboard"].loaded .app-main > section {
  animation: section-reveal .35s cubic-bezier(.2, .7, .25, 1) backwards;
}
.app-body[data-page="dashboard"].loaded .app-main > section:nth-child(1) { animation-delay: .05s; }
.app-body[data-page="dashboard"].loaded .app-main > section:nth-child(2) { animation-delay: .12s; }
.app-body[data-page="dashboard"].loaded .app-main > section:nth-child(3) { animation-delay: .19s; }
.app-body[data-page="dashboard"].loaded .app-main > section:nth-child(4) { animation-delay: .26s; }
.app-body[data-page="dashboard"].loaded .app-main > section:nth-child(5) { animation-delay: .33s; }

.hero h2 {
  font-size: 32px;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
  animation: slideUp .5s var(--ease-bounce);
}
.hero .muted { color: var(--fg-muted); margin: 0; animation: slideUp .5s var(--ease-bounce) .1s both; }

.muted { color: var(--fg-muted); }

.action-grid {
  margin-top: 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}

.action-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 28px 22px 22px;
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .28s var(--ease-bounce), box-shadow .25s var(--ease), border-color .25s var(--ease);
  animation: slideUp .5s var(--ease-bounce) var(--delay, 0ms) both;
  position: relative;
  overflow: hidden;
}
.action-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity .3s var(--ease);
  z-index: 0;
}
.action-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px var(--accent-ring);
  border-color: var(--accent);
}
.action-card:hover::before { opacity: .04; }
.action-card > * { position: relative; z-index: 1; }
.action-icon { font-size: 36px; margin-bottom: 10px; transition: transform .4s var(--ease-bounce); }
.action-card:hover .action-icon { transform: scale(1.15) rotate(-5deg); }
.action-card h3 { margin: 8px 0 6px; font-size: 19px; }
.action-card p { margin: 0; font-size: 13px; color: var(--fg-muted); }

.my-tickets { margin-top: 44px; animation: slideUp .5s var(--ease-bounce) .3s both; }
.my-tickets h3 { margin: 0 0 14px; font-size: 19px; }
.ticket-list { display: flex; flex-direction: column; gap: 10px; }
.ticket-row {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 16px 18px;
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.ticket-row:hover { transform: translateX(4px); border-color: var(--accent); box-shadow: var(--shadow-md); }
.ticket-row .meta { font-size: 12px; color: var(--fg-faint); margin-top: 2px; }
.badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.badge-open { background: var(--accent-ghost); color: var(--accent-dark); }
.badge-progress { background: #fff4de; color: #a85b00; }
.badge-closed { background: var(--bg-soft); color: var(--fg-muted); border: 1px solid var(--border); }
/* Status-Badges für In-Game-Tickets (ps_tickets Status-Werte). */
.badge-accepted { background: #fff4de; color: #a85b00; }
[data-theme="dark"] .badge-accepted { background: #3a2a10; color: #ffba6b; }

/* Chat-Bubbles für die Ticket-Konversation im Panel. */
.chat-msg {
  padding: 10px 12px; margin: 8px 0; border-radius: 10px;
  max-width: 85%; word-wrap: break-word;
}
.chat-msg-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 4px; font-size: 12px; }
.chat-msg-body { font-size: 14px; }
.chat-user  { background: var(--bg-soft); margin-right: auto; border: 1px solid var(--border); }
.chat-staff { background: var(--accent-ghost); margin-left: auto; border: 1px solid var(--accent-dark); color: var(--fg); }
[data-theme="dark"] .chat-staff { background: #1e3a5f; border-color: #3a6ba8; }

/* Reply-Formular unter der Konversation. */
.ticket-reply-box { display: flex; gap: 10px; margin-top: 14px; }
.ticket-reply-box textarea {
  flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--border);
  font-family: inherit; font-size: 14px; resize: vertical; background: var(--bg); color: var(--fg);
}
.ticket-reply-box button { align-self: flex-end; }

/* "X neu" Badge an unread Ticket-Karten. */
.unread-badge {
  background: #ff4d4d; color: white; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; margin-left: 8px;
}
[data-theme="dark"] .badge-progress { background: #3a2a10; color: #ffba6b; }
.badge-cluster { background: #ffe3e3; color: #a01010; border: 1px solid #e4a0a0; font-weight: 600; margin-left: 4px; }
[data-theme="dark"] .badge-cluster { background: #3a1414; color: #ff9b9b; border-color: #7a2a2a; }
.ticket-card.cluster { border-left: 3px solid #e03b3b; }
.cluster-info { color: #a01010; font-size: 0.85em; margin-top: 2px; }
[data-theme="dark"] .cluster-info { color: #ff9b9b; }

/* Related Reports im Detail-View */
.related-report-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.related-report-item {
  display: block; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); text-decoration: none; color: inherit; transition: background .15s;
}
.related-report-item:hover { background: var(--bg-soft); }
.related-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.related-reason { color: var(--fg-muted); font-size: 0.9em; }

/* Checkbox im Close-Modal */
.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; }
.checkbox-row input[type=checkbox] { width: 18px; height: 18px; cursor: pointer; }

.empty-hint { color: var(--fg-muted); }

/* ─── Modal ─── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 40, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  z-index: 40;
  backdrop-filter: blur(6px);
  animation: fadeIn .22s var(--ease);
}
.modal-backdrop[hidden] { display: none; }  /* HTML hidden attribute erzwingen */

.modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  max-width: 560px;
  width: 100%;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn .3s var(--ease-bounce);
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 22px 10px; }
.modal-head h3 { margin: 0; font-size: 19px; }
.modal-close { background: transparent; border: none; color: var(--fg-muted); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); transition: background .18s var(--ease); }
.modal-close:hover { background: var(--bg-soft); color: var(--fg); }

.form-body { padding: 12px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }

/* ─── Toast ─── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--fg);
  color: var(--bg);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  z-index: 60;
  transition: transform .35s var(--ease-bounce);
}
.toast.show { transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: block; }  /* mit animation statt display:none */

/* ─── Animations ─── */

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Mobile ─── */

@media (max-width: 760px) {
  /* ── Login-Seite: Rail vertikal, Form-Panel slidet oben↔unten ───── */
  .auth-body { padding: 12px; min-height: 100vh; }
  .auth-rail {
    width: 100%;
    min-height: calc(100dvh - 24px);
    flex-direction: column;
    border-radius: var(--radius-md);
  }
  .rail-side { flex: 0 0 40%; padding: 24px 20px; gap: 10px; }
  .rail-side .brand { font-size: 22px; }
  .rail-side p { font-size: 12px; max-width: 100%; }
  .btn-outline { padding: 9px 20px; font-size: 13px; }

  .form-slider {
    top: 12px;
    left: 12px;
    width: calc(100% - 24px);
    height: calc(60% - 24px);
  }
  .auth-rail.register-mode .form-slider {
    transform: translate3d(0, calc(100% / 0.6 - 100%), 0);
  }
  .form-slider .auth-form { padding: 20px 18px; }
  .form-slider h2 { font-size: 20px; }
  .form-slider .muted.small { font-size: 12px; }

  /* Theme-Toggle ins Header-Area statt fix */
  .theme-toggle { top: 10px; right: 10px; width: 38px; height: 38px; }

  /* Verify-Code auch kleiner auf mobile */
  .verify-code { font-size: 22px; letter-spacing: 4px; padding: 8px 14px; }

  /* ── Dashboard-Header kompakter ─────────────────────────── */
  .app-header-inner { padding: 10px 14px; }
  .app-header .brand { font-size: 20px; }
  .app-main { padding: 20px 14px; }

  /* ── Hero + Grid responsive ─────────────────────────────── */
  .hero h2 { font-size: 22px; }
  .hero .muted { font-size: 13px; }
  .action-grid { gap: 12px; margin-top: 20px; }
  .action-card { padding: 18px 16px 16px; border-radius: var(--radius-md); }
  .action-icon { font-size: 28px; margin-bottom: 6px; }
  .action-card h3 { font-size: 15px; }
  .action-card p { font-size: 12px; }

  .my-tickets h3, .staff-section h3 { font-size: 16px; }
  .ticket-row { padding: 12px 14px; }
  .ticket-row strong { font-size: 14px; }
  .ticket-row .meta { font-size: 11px; }

  /* Avatar + Menu */
  .avatar-btn { width: 36px; height: 36px; }
  .avatar-btn img { width: 32px; height: 32px; }
  .avatar-menu { min-width: 180px; right: -4px; }

  /* ── Modals vollflächig auf Mobile ───────────────────────── */
  .modal-backdrop { padding: 0; align-items: stretch; }
  .modal {
    max-height: 100dvh;
    height: auto;
    border-radius: 0;
    max-width: 100%;
    display: flex;
    flex-direction: column;
  }
  .modal-head { padding: 14px 16px 8px; }
  .modal-head h3 { font-size: 16px; }
  .form-body { padding: 10px 16px 20px; gap: 10px; }
  .settings-tabs { margin: 0 16px; }
  .settings-tab { padding: 10px 14px; font-size: 13px; }
  .twofa-box { margin: 10px 16px 16px; padding: 14px 16px; }

  /* ── Verify-/Password-Reset-Box ──────────────────────────── */
  .verify-box { padding: 18px 14px; }
  .verify-cmd, code.verify-cmd { font-size: 13px !important; padding: 8px 12px !important; }

  /* ── Tickets-SPA ─────────────────────────────────────────── */
  .spa-main { padding: 16px 12px 80px; }
  .spa-nav { margin-bottom: 14px; }
  .list-head { gap: 10px; align-items: stretch; }
  .list-head h2 { font-size: 22px; }
  .list-head .muted { font-size: 12px; }
  .list-actions { flex-wrap: wrap; }
  .status-slider { flex: 1; justify-content: space-between; }
  .s-opt { flex: 1; padding: 7px 8px; font-size: 12px; }
  .btn-fab-lg { padding: 10px 14px; font-size: 13px; width: 100%; justify-content: center; }

  .ticket-card { padding: 14px 16px; }
  .ticket-card-head strong { font-size: 14px; }
  .list-empty { padding: 40px 20px; }
  .list-empty-icon { font-size: 44px; }
  .list-empty h3 { font-size: 18px; }

  /* ── Chat ──────────────────────────────────────────────── */
  .chat-head { padding: 14px 0; gap: 8px; }
  .chat-head h2 { font-size: 18px; }
  .chat-meta { font-size: 11px; }
  #viewChat .chat-messages { padding: 14px; min-height: 240px; }
  .chat-bubble { max-width: 88%; padding: 9px 12px; }
  .bubble-text { font-size: 13px; }
  .bubble-meta { font-size: 10px; }
  .attach-image { max-width: 160px; max-height: 160px; }
  #viewChat .chat-composer { padding: 10px 12px; margin-bottom: 10px; border-radius: var(--radius-sm); }
  .chat-input-row { gap: 6px; }
  .chat-attach-btn { width: 38px; height: 38px; }
  .chat-input-row textarea { font-size: 14px; padding: 10px 12px; min-height: 38px; }
  .chat-send-btn { width: 40px; height: 40px; }

  /* ── Original-Ticket-Card ─────────────────────────────── */
  .original-ticket { padding: 16px 18px; margin-bottom: 14px; }
  .orig-head { gap: 10px; padding-bottom: 12px; }
  .orig-icon { font-size: 26px; }
  .orig-subject { font-size: 17px; }
  .orig-type { font-size: 10px; }
  .orig-date { font-size: 10px; }
  .orig-field { padding: 10px 12px; }
  .orig-field-key { font-size: 10px; }
  .orig-field-value { font-size: 13px; }
  .orig-attachments .attach-image { max-width: 140px; max-height: 140px; }

  /* ── Big-Form (Antrag erstellen) ──────────────────────── */
  .big-form { padding: 20px 18px; border-radius: var(--radius-md); }
  .field-lg label { font-size: 12px; }
  .field-lg input, .field-lg select, .field-lg textarea { font-size: 15px; padding: 12px 14px; }
  .field-lg textarea { min-height: 140px; }
  .field-row { grid-template-columns: 1fr; gap: 16px; }
  .btn-primary-lg { width: 100%; padding: 12px 18px; justify-content: center; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .btn-ghost { width: 100%; justify-content: center; }

  /* ── Announcements ───────────────────────────────────── */
  .ann-card { padding: 14px 16px; }
  .ann-card h3 { font-size: 16px; }
  .ann-body { font-size: 13px; }

  /* ── Staff-Section Grid ──────────────────────────────── */
  .staff-grid { gap: 10px; margin-bottom: 18px; }
  .staff-card { padding: 16px 14px; }
  .staff-card h3 { font-size: 14px; }

  /* Toast kleiner */
  .toast { bottom: 14px; padding: 10px 16px; font-size: 13px; }

  /* ── Force-2FA-Overlay auf Mobile ───────────────────── */
  .force-2fa-card { padding: 26px 20px; }
  .force-2fa-card h2 { font-size: 18px; }
  .force-2fa-icon { font-size: 44px; }

  /* ── Unban-Panel Buttons wrappen ────────────────────── */
  .ban-actions { flex-wrap: wrap; }
  .ban-actions .btn-primary, .ban-actions .btn-ghost { flex: 1; min-width: 140px; justify-content: center; }
}

/* iPhone Notch + Home-Indicator safe area */
@supports (padding: max(0px)) {
  @media (max-width: 760px) {
    .app-header-inner { padding-top: max(10px, env(safe-area-inset-top)); }
    .spa-main, .app-main { padding-bottom: max(20px, env(safe-area-inset-bottom)); }
    #viewChat .chat-composer { margin-bottom: max(10px, env(safe-area-inset-bottom)); }
  }
}

/* ═══ Skeleton Loaders ══════════════════════════════════════════════ */
.skeleton {
  background:
    linear-gradient(90deg,
      var(--surface-2) 0%,
      rgba(255,255,255,.07) 50%,
      var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
  border-radius: 8px;
  will-change: background-position;
}
@keyframes skeletonShimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}
.skeleton-line { height: 12px; border-radius: 6px; margin: 6px 0; }
.skeleton-line.short  { width: 40%; }
.skeleton-line.medium { width: 70%; }
.skeleton-line.long   { width: 90%; }
.skeleton-circle { border-radius: 50%; }

.skeleton-ticket-card {
  display: block;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  margin-bottom: 10px;
}
.skeleton-ticket-card .skeleton-line.title { height: 16px; width: 55%; margin-bottom: 10px; }
.skeleton-ticket-card .skeleton-line.sub   { height: 10px; width: 35%; }

.skeleton-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  margin-bottom: 8px;
}
.skeleton-row-left { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.skeleton-row .skeleton-line.title { height: 14px; width: 60%; }
.skeleton-row .skeleton-line.sub   { height: 10px; width: 35%; }
.skeleton-row .skeleton-badge      { width: 60px; height: 22px; border-radius: 11px; }

.chat-messages .skeleton-bubble {
  max-width: 55%;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 10px;
  background: var(--surface-2);
}
.chat-messages .skeleton-bubble.user  { align-self: flex-end; margin-left: auto; }
.chat-messages .skeleton-bubble.staff { align-self: flex-start; }
.skeleton-bubble .skeleton-line { height: 11px; margin: 5px 0; background:
  linear-gradient(90deg, rgba(255,255,255,.04) 0%, rgba(255,255,255,.1) 50%, rgba(255,255,255,.04) 100%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}

.skeleton-ann-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  margin-bottom: 12px;
}
.skeleton-ann-card .skeleton-line.title { height: 18px; width: 50%; margin-bottom: 12px; }
.skeleton-ann-card .skeleton-line.body  { height: 10px; }

.content-fadein { animation: contentFadeIn .25s ease; }
@keyframes contentFadeIn {
  from { opacity: 0; transform: translate3d(0, 4px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* ═══ Staff-Panel ═══════════════════════════════════════════════════ */
.staff-tabs {
  display: flex;
  gap: 4px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  /* Opaker Background verhindert dass gescrollter Content durchscheint. */
  background: var(--surface, #ffffff);
  position: sticky;
  top: 56px;
  z-index: 20;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
[data-theme="dark"] .staff-tabs {
  background: var(--surface, #141a2b);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.staff-tab {
  padding: 14px 20px;
  color: var(--text-dim);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-color .2s;
  font-weight: 500;
}
.staff-tab:hover { color: var(--text); }
.staff-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Report-Status-Pills */
.status-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.status-pill {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all .2s;
}
.status-pill:hover { border-color: var(--accent); color: var(--text); }
.status-pill.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.list-controls {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.search-input {
  flex: 1;
  min-width: 240px;
  max-width: 400px;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.search-input-lg {
  width: 100%;
  max-width: 600px;
  padding: 14px 18px;
  font-size: 16px;
  margin-bottom: 20px;
}
.search-input:focus { outline: none; border-color: var(--accent); }

/* Ticket-Card für "mine" (eigene Claims) */
.ticket-card.mine {
  border-left: 3px solid var(--accent);
}
.report-reason-preview {
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

/* Report-Detail */
.report-detail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.report-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.report-meta {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.report-meta .link-sub {
  color: var(--accent);
  font-size: 13px;
  margin-left: 4px;
}
.report-reason-box {
  padding: 14px 16px;
  background: var(--surface-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  margin-bottom: 20px;
}
.report-reason {
  margin: 6px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}
.report-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
/* Panel-Action-Buttons sichtbar auf weißem Hintergrund (btn-outline war weiß auf weiß). */
.action-btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  transition: background .15s ease, border-color .15s ease;
}
.action-btn:hover:not(:disabled) { background: var(--bg-soft); }
.action-btn:disabled { opacity: .5; cursor: not-allowed; }
.action-btn-close { border-color: #d4493a; color: #d4493a; }
.action-btn-close:hover:not(:disabled) { background: #d4493a; color: white; }
[data-theme="dark"] .action-btn-close { border-color: #ff6b5a; color: #ff6b5a; }
[data-theme="dark"] .action-btn-close:hover:not(:disabled) { background: #ff6b5a; color: #1a0f0d; }
.action-divider {
  width: 1px;
  background: var(--border);
  margin: 0 4px;
}
.report-section {
  margin-top: 24px;
}
.report-section h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}

/* Buttons: Danger + Warning Varianten */
.btn-danger {
  background: #dc3545;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-danger:hover { background: #c82333; transform: translateY(-1px); }
.btn-warning {
  background: #ffc107;
  color: #333;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background .2s, transform .1s;
}
.btn-warning:hover { background: #e0a800; transform: translateY(-1px); }

/* Replay-Section */
.replay-empty, .replay-ready, .replay-pending {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 16px;
}
.replay-pending-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.replay-pending-head .upload-spinner { width: 18px; height: 18px; }
.replay-ready-info {
  margin-bottom: 12px;
}
.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.replay-cmd {
  flex: 1;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-copy {
  padding: 10px 14px;
  white-space: nowrap;
}

/* Chatlog-Box */
.chatlog-box {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 12px;
  max-height: 400px;
  overflow-y: auto;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 13px;
}
.chatlog-line {
  display: flex;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid var(--border);
}
.chatlog-line:last-child { border-bottom: none; }
.chatlog-time {
  color: var(--text-dim);
  min-width: 110px;
  flex-shrink: 0;
}
.chatlog-msg { word-break: break-word; }

/* Spielersuche */
.player-search-results {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 20px;
}
.player-search-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .1s;
}
.player-search-item:hover { border-color: var(--accent); transform: translateY(-1px); }
.player-head-sm {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  image-rendering: pixelated;
}

/* Spielerprofil */
.player-profile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.player-head {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.player-avatar {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  image-rendering: pixelated;
}
.player-sub {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--text-dim);
  font-size: 14px;
}
.player-sub .dot { opacity: .5; }
.player-actions {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.profile-card {
  background: var(--surface-2);
  border-radius: 10px;
  padding: 16px;
}
.profile-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 12px;
}
.status-row {
  background: var(--surface);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  border-left: 3px solid var(--text-dim);
}
.status-row.danger { border-left-color: #dc3545; }
.status-row.warning { border-left-color: #ffc107; }
.alt-row, .name-row {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  transition: background .2s;
  margin-bottom: 4px;
}
.alt-row:hover { background: var(--surface); }

.profile-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
  overflow-x: auto;
}
.profile-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-weight: 500;
  white-space: nowrap;
  transition: all .2s;
}
.profile-tab:hover { color: var(--text); }
.profile-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.profile-section {
  margin-bottom: 24px;
}
.profile-section h4 {
  font-size: 14px;
  margin-bottom: 8px;
}
.history-table, .stat-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface-2);
  border-radius: 8px;
  overflow: hidden;
}
.history-table th, .stat-table th,
.history-table td, .stat-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.history-table th, .stat-table th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .5px;
}
.history-table tr:last-child td,
.stat-table tr:last-child td { border-bottom: none; }

/* Replay-Row im Spielerprofil */
.replay-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 8px;
  margin-bottom: 8px;
  gap: 12px;
}

/* Admin-Stats */
.stat-period {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 20px;
}
.stat-period select {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}
.stat-card h3 {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text-dim);
  margin-bottom: 16px;
}
.reason-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.reason-row:last-child { border-bottom: none; }

/* ─── Stats-Seite 2026-10 Redesign ──────────────────────────────── */
.stats-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 20px; margin-bottom: 24px; flex-wrap: wrap;
}
.stats-head h2 { margin: 0 0 4px; font-size: 24px; }
.period-select {
  padding: 10px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 14px; cursor: pointer;
  transition: border-color .15s ease;
}
.period-select:hover { border-color: var(--accent-dark); }

/* KPI-Hero */
.kpi-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 24px;
}
.kpi-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 20px; position: relative; overflow: hidden;
}
.kpi-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
}
.kpi-ban::before    { background: #d4493a; }
.kpi-mute::before   { background: #e39b2e; }
.kpi-warn::before   { background: #c9a832; }
.kpi-report::before { background: #4a7fcd; }
.kpi-icon { font-size: 28px; line-height: 1; }
.kpi-body { flex: 1; }
.kpi-label { font-size: 12px; text-transform: uppercase; color: var(--text-dim, var(--fg-muted)); letter-spacing: .5px; }
.kpi-value { font-size: 28px; font-weight: 700; line-height: 1.1; margin-top: 2px; }

.stat-card-wide { grid-column: 1 / -1; }
.stat-card-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.stat-card-head h3 { font-size: 15px; text-transform: none; letter-spacing: 0; color: var(--text, var(--fg)); margin: 0; }

/* Staff-Leaderboard-Rows mit Fortschrittsbalken */
.lb-row {
  display: flex; gap: 14px; padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.lb-row:last-child { border-bottom: none; }
.lb-rank { font-size: 20px; width: 32px; text-align: center; align-self: center; }
.lb-body { flex: 1; }
.lb-name { font-size: 14px; margin-bottom: 4px; }
.lb-bar { height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden; margin: 4px 0; }
.lb-bar > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--accent-dark, #4a7fcd), var(--accent, #6b9cde));
  border-radius: 3px; transition: width .4s ease;
}
.lb-detail { display: flex; gap: 10px; font-size: 11px; }

/* Progress-Bars für Ban-Gründe */
.bar-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.bar-row:last-child { border-bottom: none; }
.bar-row-head { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 13px; }
.bar-track { height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden; }
.bar-track > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, #d4493a, #e86b5c);
  border-radius: 3px; transition: width .4s ease;
}

/* Report-Status-Dots */
.dot-row {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 14px;
}
.dot-row:last-child { border-bottom: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-open     { background: #e39b2e; }
.dot-progress { background: #4a7fcd; }
.dot-closed   { background: #999; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  /* Opaker Background — verhindert durchscheinenden Content beim Scrollen. */
  background: var(--surface, #ffffff);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
}
[data-theme="dark"] .topbar { background: var(--surface, #141a2b); }
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .back-link {
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 6px;
  transition: background .2s;
}
.topbar .back-link:hover { background: var(--surface-2); color: var(--text); }
.topbar-actions { margin-left: auto; }

.spa-container {
  padding: 20px;
  max-width: 1200px;
  margin: 0 auto;
}
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.modal-wide { max-width: 600px; }

/* Mobile */
@media (max-width: 640px) {
  .staff-tabs { padding: 0 10px; }
  .staff-tab { padding: 12px 14px; font-size: 14px; }
  .spa-container { padding: 12px; }
  .report-detail, .player-profile { padding: 16px; }
  .player-head { flex-direction: column; align-items: flex-start; }
  .player-actions { margin-left: 0; width: 100%; }
  .copy-row { flex-direction: column; align-items: stretch; }
  .replay-cmd { font-size: 11px; }
  .status-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .status-pill { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .blob { animation: none; }
  .skeleton, .skeleton-bubble .skeleton-line { animation: none; opacity: .6; }
}

/* Login-Brand-Icon responsiv (cap'd per vh damit auf Mobile nicht die halbe Höhe schluckt). */
.rail-side .brand img {
  height: 144px;
  width: auto;
  max-width: 85%;
  max-height: 22vh;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}
@media (max-width: 760px) {
  .rail-side .brand img { height: 96px; max-height: 14vh; }
  .rail-side .brand { margin-bottom: 4px !important; }
  .rail-side { padding: 16px 12px !important; gap: 6px !important; flex: 0 0 auto !important; min-height: auto; }
  .rail-side p { font-size: 11px; line-height: 1.4; margin-top: 4px; }
}
