/* ============================================================
   FSBS INTERN — Central Design System & Stylesheet
   ============================================================ */

:root {
  --bg1: #120e18;
  --bg2: #1a1424;
  --bg3: #1f162c;
  
  --accent1: #f97316;
  --accent2: #a855f7;
  
  --glass: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.18);
  
  --text: rgba(255, 255, 255, 0.92);
  --muted: rgba(255, 255, 255, 0.65);
  
  --shadow: 0 20px 55px rgba(0, 0, 0, 0.50);
  
  --ok: rgba(34, 197, 94, 0.95);
  --bad: rgba(239, 68, 68, 0.95);
  --warn: rgba(251, 146, 60, 0.95);
  
  --danger1: #fb7185;
  --danger2: #e11d48;

  /* Canonical Ressort-Pills */
  --rx-a1: rgba(249, 115, 22, 0.24);  --rx-a2: rgba(251, 146, 60, 0.14);
  --rx-p1: rgba(168, 85, 247, 0.24);  --rx-p2: rgba(124, 58, 237, 0.14);
  --rx-b1: rgba(56, 189, 248, 0.20);  --rx-b2: rgba(14, 165, 233, 0.12);
  --rx-g1: rgba(34, 197, 94, 0.22);   --rx-g2: rgba(16, 185, 129, 0.12);
  --rx-r1: rgba(239, 68, 68, 0.18);   --rx-r2: rgba(251, 113, 133, 0.12);
}

/* ============================================================
   Resets & Base Layout
   ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  min-height: 100%;
}

html {
  background:
    radial-gradient(900px 500px at 15% 10%, rgba(249, 115, 22, 0.25), transparent 60%),
    radial-gradient(900px 500px at 85% 20%, rgba(168, 85, 247, 0.22), transparent 60%),
    radial-gradient(800px 450px at 60% 90%, rgba(124, 58, 237, 0.18), transparent 60%),
    linear-gradient(135deg, var(--bg1), var(--bg2), var(--bg3));
  background-attachment: fixed;
}

@supports (-webkit-touch-callout: none) {
  html {
    background-attachment: scroll;
  }
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: transparent;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 42px 16px 60px;
  overflow-x: hidden;
  animation: pageIn 0.38s ease both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  body {
    animation: none !important;
  }
}

.app {
  width: 100%;
  max-width: 1200px;
}

/* ============================================================
   A11y & Custom Scrollbars
   ============================================================ */
/* Clear Focus Rings */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--accent1);
  outline-offset: 2px;
}

/* Webkit Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(20, 13, 38, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* Firefox Scrollbars */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.12) rgba(20, 13, 38, 0.3);
}

/* ============================================================
   Glass Panels & Cards
   ============================================================ */
.glass {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.card {
  padding: 20px;
  margin-bottom: 16px;
}

/* ============================================================
   Top Bar / Brand Elements
   ============================================================ */
.top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

h1 {
  font-size: 32px;
  letter-spacing: 0.4px;
  margin: 0;
}

.subtitle {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.brandLeft {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brandLogo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  padding: 6px;
  display: grid;
  place-items: center;
  text-decoration: none;
  flex: 0 0 auto;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.16s ease, filter 0.16s ease, background 0.16s ease;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  letter-spacing: 0.2px;
}

.brandLogo:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  background: rgba(255, 255, 255, 0.12);
}

.brandLogo img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

@media (max-width: 640px) {
  .brandLogo {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    padding: 5px;
  }
  .brandLogo img {
    border-radius: 9px;
  }
}

/* ============================================================
   Buttons & User Actions
   ============================================================ */
button {
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 650;
  font-family: inherit;
  font-size: inherit;
  touch-action: manipulation;
  transition: transform 0.16s ease, filter 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:active {
  transform: translateY(0px) scale(0.98);
}

button:disabled {
  cursor: not-allowed !important;
  opacity: 0.45 !important;
  transform: none !important;
  filter: none !important;
  box-shadow: none !important;
}

button:disabled:hover {
  transform: none !important;
  filter: none !important;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent1), var(--accent2));
  color: #0f0b16;
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.25);
  font-weight: 700;
}

.btn-primary:not(:disabled):hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 18px 36px rgba(249, 115, 22, 0.25), 0 0 40px rgba(168, 85, 247, 0.25);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.14);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:not(:disabled):hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.btn-danger {
  background: linear-gradient(135deg, var(--danger1), var(--danger2));
  color: #0f0b16;
  box-shadow: 0 12px 30px rgba(225, 29, 72, 0.25);
  font-weight: 700;
}

.btn-danger:not(:disabled):hover {
  transform: translateY(-2px);
  filter: brightness(1.05);
  box-shadow: 0 18px 36px rgba(244, 63, 94, 0.25), 0 0 40px rgba(225, 29, 72, 0.25);
}

/* ============================================================
   Inputs & Controls
   ============================================================ */
input, select, textarea {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  outline: none;
  font-size: 16px;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
  width: 100%;
}

input::placeholder, textarea::placeholder {
  color: rgba(255, 255, 255, 0.45);
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(249, 115, 22, 0.55);
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}

select option {
  background: #1a1424;
  color: rgba(255, 255, 255, 0.92);
}

textarea {
  resize: vertical;
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}

/* ============================================================
   Identity / Authentication Badges
   ============================================================ */
.authFloating {
  border-radius: 999px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.40);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  user-select: none;
  max-width: min(560px, 100%);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  position: relative;
}

.dot.ok {
  background: var(--ok);
  box-shadow:
    0 0 0 2px rgba(34, 197, 94, 0.20),
    0 0 18px rgba(34, 197, 94, 0.55),
    0 0 42px rgba(34, 197, 94, 0.30);
}

.dot.warn {
  background: rgba(255, 255, 255, 0.35);
}

.dot.bad {
  background: var(--bad);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18);
}

.authAvatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.3px;
  color: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
  background: rgba(255, 255, 255, 0.10);
  flex: 0 0 auto;
}

.authInfo {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
  min-width: 0;
  flex: 1 1 auto;
}

.authState {
  font-size: 13px;
  font-weight: 750;
  letter-spacing: 0.25px;
}

.authTopLine {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.authCompact {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.authNameInline {
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.15px;
  color: rgba(255, 255, 255, 0.92);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.rolePill {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.86);
  font-weight: 900;
  font-size: 11px;
  letter-spacing: 0.10px;
  line-height: 1;
  white-space: nowrap;
}

.rolePill.vorstand {
  border-color: rgba(56, 189, 248, 0.40);
  background: rgba(56, 189, 248, 0.12);
}

.rolePill.ressortleiter {
  border-color: rgba(251, 146, 60, 0.35);
  background: rgba(251, 146, 60, 0.12);
}

.rolePill.protokollfuehrer {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.12);
}

.authChevron {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  width: 30px;
  height: 26px;
  border-radius: 999px;
  padding: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.authChevron:hover {
  background: rgba(255, 255, 255, 0.10);
  transform: translateY(-1px);
}

.authDetails {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.authMail {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
  word-break: break-all;
}

/* ============================================================
   Navigation Wrap
   ============================================================ */
.navWrap {
  margin-bottom: 16px;
  position: sticky;
  top: 14px;
  z-index: 6;
}

.nav {
  display: flex;
  gap: 2px;
  align-items: center;
  padding: 5px 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav::-webkit-scrollbar {
  display: none;
}

.navLeft {
  display: flex;
  gap: 2px;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.navRight {
  flex: 0 0 auto;
  padding-left: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  margin-left: 4px;
}

.navLink {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.65);
  border: 1px solid transparent;
  white-space: nowrap;
  user-select: none;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.14s;
}

.navLink:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.navLink.active {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.22), rgba(168, 85, 247, 0.16));
  border-color: rgba(249, 115, 22, 0.32);
  color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 3px 14px rgba(249, 115, 22, 0.18);
}

/* ============================================================
   Grid & Layout System
   ============================================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
}

.kpi {
  grid-column: span 4;
  padding: 18px;
  border-radius: 22px;
}

.kpiBig {
  grid-column: span 6;
}

.kpiFull {
  grid-column: 1 / -1;
}

.kpiCard {
  position: relative;
  overflow: hidden;
  transition: transform 0.16s ease, filter 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.kpiCard:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.11);
}

.kpiTop {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.kpiTitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.70);
  font-weight: 700;
  letter-spacing: 0.2px;
}

.kpiValue {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 0.2px;
}

.kpiSub {
  margin-top: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.62);
  line-height: 1.4;
}

.kpiIcon {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.kpiActions {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.kpiActions .btn-secondary {
  padding: 10px 12px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 12px;
}

.small {
  font-size: 13px;
  color: var(--muted);
}

.hr {
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
  margin: 12px 0 0;
}

/* ============================================================
   Ressort Lists & Badges
   ============================================================ */
.ressortList {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.92);
  font-weight: 900;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}

.badge strong {
  font-weight: 900;
}

/* ============================================================
   Dialog / Modal Elements
   ============================================================ */
/* Closed dialogs must be hidden — older iOS Safari ignores the UA rule without this */
dialog:not([open]) {
  display: none !important;
}

dialog {
  border: none;
  padding: 16px;
  background: transparent;
  /* Browser centres showModal() dialogs natively — no position overrides needed */
  width: min(640px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  overflow: visible;
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.dlgShell {
  background: rgba(22, 15, 35, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 28px 28px 24px;
  width: 100%;
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  animation: modalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

@media (max-width: 640px) {
  dialog {
    padding: 0;
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - env(safe-area-inset-top, 20px) - 12px);
    /* Slide up from bottom: shift the browser's native centre-position downward */
    margin-bottom: 0;
  }
  .dlgShell {
    border-radius: 24px 24px 0 0;
    max-height: calc(100dvh - env(safe-area-inset-top, 20px) - 16px);
    animation: modalInMobile 0.28s cubic-bezier(0.32, 0.94, 0.6, 1) both;
  }
}

/* ============================================================
   Common Helpers & Utilities
   ============================================================ */
.hidden {
  display: none !important;
}

/* ============================================================
   Responsive Adaptations
   ============================================================ */
@media (max-width: 900px) {
  .kpi {
    grid-column: span 6;
  }
  .kpiBig {
    grid-column: span 12;
  }
}

@media (max-width: 640px) {
  body {
    padding: 24px 14px;
  }
  h1 {
    font-size: 26px;
  }
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .authNameInline {
    max-width: 150px;
  }
  .navWrap {
    top: 10px;
  }
  .kpi {
    grid-column: span 12;
  }
}

/* ============================================================
   MV Widget Specific Styles
   ============================================================ */
.mvWidget {
  margin-top: 16px;
}

.mvCompact {
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.mvCompact::before {
  content: "";
  position: absolute;
  inset: -90px;
  background:
    radial-gradient(circle at 15% 20%, rgba(249, 115, 22, 0.24), transparent 32%),
    radial-gradient(circle at 82% 26%, rgba(168, 85, 247, 0.18), transparent 34%),
    radial-gradient(circle at 55% 90%, rgba(56, 189, 248, 0.13), transparent 36%);
  filter: blur(18px);
  opacity: 0.95;
  pointer-events: none;
}

.mvCompact > * {
  position: relative;
  z-index: 1;
}

.mvLeft {
  min-width: 0;
  flex: 1 1 auto;
}

.mvEyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.24);
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.18), rgba(168, 85, 247, 0.12));
  color: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.15px;
}

.mvTitle {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 950;
  letter-spacing: 0.2px;
}

.mvSub {
  margin-top: 7px;
  color: rgba(255, 255, 255, 0.70);
  line-height: 1.45;
  font-size: 13px;
  max-width: 640px;
}

.mvStats {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mvStat {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.84);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.14);
}

.mvStat strong {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.98);
}

.mvRight {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
}

.mvOpenBtn {
  background: linear-gradient(135deg, rgba(249, 115, 22, 0.95), rgba(168, 85, 247, 0.92));
  color: #120e18;
  font-weight: 900;
  padding: 12px 18px;
  border-radius: 16px;
  box-shadow: 0 14px 28px rgba(249, 115, 22, 0.16), 0 14px 28px rgba(168, 85, 247, 0.14);
}

.mvOpenBtn:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

@media (max-width: 640px) {
  .mvCompact {
    flex-direction: column;
    align-items: flex-start;
  }
  .mvRight {
    width: 100%;
  }
  .mvOpenBtn {
    width: 100%;
  }
}

/* ============================================================
   Login / Step Specific Styles
   ============================================================ */
.step {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.step.hidden {
  display: none !important;
}

.pollWrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.18);
  font-size: 13px;
  color: rgba(56, 189, 248, 0.9);
}

.pollDot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.8);
  flex-shrink: 0;
  animation: pulsePoll 1.4s ease-in-out infinite;
}

@keyframes pulsePoll {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: 0.4; transform: scale(0.75); }
}

.divider {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.28);
  font-size: 12px;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.10);
}

.sentInfo {
  padding: 10px 14px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.10);
  font-size: 13px;
  color: var(--muted);
}

.sentInfo strong {
  color: var(--text);
  font-size: 14px;
}

/* ============================================================
   Pill / Shimmer Badges
   ============================================================ */
@keyframes pillShimmer {
  0%   { transform: translateX(-40%); opacity: 0; }
  20%  { opacity: 0.35; }
  60%  { opacity: 0.15; }
  100% { transform: translateX(140%); opacity: 0; }
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.90);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.pill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  width: 40%;
  transform: translateX(-50%);
  animation: pillShimmer 2.6s ease-in-out infinite;
  pointer-events: none;
  opacity: 0;
}

.pill:hover::after {
  opacity: 0.35;
}

.pill-status-volle { background: rgba(34, 197, 94, 0.20);  border-color: rgba(34, 197, 94, 0.35);  color: #bbf7d0; }
.pill-status-anw   { background: rgba(56, 189, 248, 0.20); border-color: rgba(56, 189, 248, 0.35); color: #c7f9ff; }
.pill-status-pau   { background: rgba(234, 179, 8, 0.20);  border-color: rgba(234, 179, 8, 0.35);  color: #fde68a; }
.pill-status-aus   { background: rgba(239, 68, 68, 0.20);  border-color: rgba(239, 68, 68, 0.35);  color: #fecaca; }

.pill-role-vorstand { background: rgba(56, 189, 248, 0.20); border-color: rgba(56, 189, 248, 0.35); color: #c7f9ff; }
.pill-role-admin    { background: rgba(168, 85, 247, 0.18); border-color: rgba(168, 85, 247, 0.32); color: #e9d5ff; }
.pill-role-leitung  { background: rgba(249, 115, 22, 0.20); border-color: rgba(249, 115, 22, 0.35); color: #fed7aa; }
.pill-role-stv      { background: rgba(251, 146, 60, 0.16); border-color: rgba(251, 146, 60, 0.30); color: #ffedd5; }

/* ============================================================
   Filter & Search Bars
   ============================================================ */
.filterBar {
  display: grid;
  grid-template-columns: 1fr 180px 180px auto auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.filterBar .countText {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
}

@media (max-width: 900px) {
  .filterBar {
    grid-template-columns: 1fr 1fr auto auto;
    grid-template-rows: auto auto;
  }
  .filterBar .searchInput { grid-column: 1 / -1; }
  .filterBar .countText   { grid-column: 1 / 3; }
}

@media (max-width: 640px) {
  .filterBar {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .filterBar .searchInput { grid-column: 1 / -1; }
  .filterBar .countText   { grid-column: 1 / -1; font-size: 12px; }
  .filterBar .btnRefresh  { grid-column: 1 / 2; }
  .filterBar .btnCreate   { grid-column: 2 / 3; }
}

@media (max-width: 420px) {
  .filterBar .btnRefresh,
  .filterBar .btnCreate {
    font-size: 13px;
    padding: 10px 12px;
  }
}

/* ============================================================
   Tables & Lists
   ============================================================ */
.tableWrap {
  overflow-x: auto;
  border-radius: 16px;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 780px;
}

thead tr {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(18, 14, 24, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

th, td {
  padding: 13px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

tbody tr {
  cursor: default;
  transition: background 0.14s ease;
}

tbody tr.clickable {
  cursor: pointer;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.06);
}

td.avatarCell { padding: 10px 8px 10px 12px; width: 52px; }
th.avatarTh   { width: 52px; }

.nameStack {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.nameStack .nameBold {
  font-weight: 700;
  font-size: 14px;
}

.nameStack .emailMuted {
  font-size: 12px;
  color: var(--muted);
}

/* ============================================================
   Icon Buttons & Action Containers
   ============================================================ */
.iconBtn {
  width: 40px;
  height: 40px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 16px;
}

.iconBtn:hover {
  transform: translateY(-2px);
}

.actions {
  display: flex;
  gap: 8px;
}

/* ============================================================
   Mobile Cards List representation
   ============================================================ */
.memberCardGrid {
  display: none;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 4px;
}

.memberCard {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 16px;
  position: relative;
  transition: border-color 0.16s ease, background 0.16s ease;
  cursor: default;
}

.memberCard:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(249, 115, 22, 0.30);
}

.memberCard .cardNr {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 11px;
  color: var(--muted);
}

.memberCard .cardTop {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
}

.memberCard .cardName {
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
}

.memberCard .cardEmail {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}

.memberCard .cardPills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.memberCard .cardActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.memberCard .cardActions button {
  padding: 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

@media (max-width: 719px) {
  .tableWrap       { display: none; }
  .memberCardGrid  { display: grid; }
}

/* ============================================================
   Dialog Shell & Edit Forms Modal specific elements
   ============================================================ */
.modalDragHandle {
  display: none;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  margin: 0 auto 20px;
}

.modalAvatarWrap {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.modalHeader {
  text-align: center;
  margin-bottom: 20px;
}

.modalTitle {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.modalSub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.closeX {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.formSection {
  margin-bottom: 20px;
}

.formSectionTitle {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.10);
}

.formGrid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.formGrid .full {
  grid-column: 1 / -1;
}

.formField {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.formLabel {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.2px;
}

.formField input,
.formField select {
  padding: 14px;
}

.modalActions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.modalActions .btn-primary   { padding: 14px 32px; font-size: 15px; font-weight: 700; }
.modalActions .btn-secondary { padding: 14px 22px; }

hr.sep {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 14px 0;
}

@media (max-width: 640px) {
  .modalDragHandle { display: block; }
  .formGrid { grid-template-columns: 1fr; }
  .modalActions { flex-direction: column-reverse; }
  .modalActions .btn-primary,
  .modalActions .btn-secondary {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

/* ============================================================
   Global Page Loader
   ============================================================ */
.pageLoader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.pageLoader.hidden { display: none; }

.spinnerRing {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.10);
  border-top-color: var(--accent1);
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .spinnerRing { animation: none; opacity: 0.5; }
}

