/* ==========================================================================
   TryCasino Admin – Kern-Stil  (Wurzel #adminApp, Klassen ap-*)
   Eigenständige Navy-Flächen, blaue Aktionen und farbige Bereichskennzeichen.
   Blau = Aktion · Gold = Geld · Smaragd = gut · Rose = Gefahr · Cyan = Info · Violett = Community.
   Seitengruppen ergänzen css/admin/admin-<gruppe>.css (nur #adminApp .ap-…-Selektoren).
   ========================================================================== */

#adminApp {
  --ap-bg: #0b1220;
  --ap-bg-2: #0e1828;
  --ap-surface: #132034;
  --ap-raised: #1b2c44;
  --ap-sunk: #0e1828;
  --ap-line: #334760;
  --ap-line-soft: #23354b;
  --ap-text: #eef4fc;
  --ap-text-2: #b2c1d5;
  --ap-muted: #93a7bf;
  --ap-accent: #326ad9;
  --ap-accent-hover: #3971df;
  --ap-accent-text: #a9ccff;
  --ap-focus: #72c7f2;
  --ap-gold: #edbb64;
  --ap-gold-hi: #f5d08a;
  --ap-gold-lo: #b48a44;
  --ap-gold-ink: #251c0c;
  --ap-good: #56cda5;
  --ap-danger: #ed8195;
  --ap-info: #62cce4;
  --ap-community: #b093ea;
  --ap-warn: #e6b577;
  --ap-good-text: #94e1c2;
  --ap-danger-text: #f5a5b5;
  --ap-warn-text: #efc991;
  --ap-info-text: #a0e1ef;
  --ap-community-text: #cfbaf5;
  --ap-font: 'Onest', 'Avenir Next', 'Segoe UI', system-ui, sans-serif;
  --ap-font-display: var(--ap-font);
  --ap-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace;
  --ap-r-lg: 16px;
  --ap-r: 11px;
  --ap-r-sm: 8px;
  --ap-shadow: 0 4px 16px -12px rgba(0, 0, 0, .32);
  --ap-shadow-pop: 0 24px 64px -20px rgba(0, 0, 0, .65);
  --ap-ease: cubic-bezier(.2, .8, .2, 1);
  --ap-top-h: 68px;
  --ap-nav-w: 264px;
  --ap-pad: 32px;
  --ap-gap: 18px;

  position: fixed;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  isolation: isolate;
  background: var(--ap-bg);
  color: var(--ap-text);
  font-family: var(--ap-font);
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}
#adminApp *, #adminApp *::before, #adminApp *::after { box-sizing: border-box; }
#adminApp [hidden] { display: none !important; }
#adminApp :where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; padding: 0; }
#adminApp :where(button, input, select, textarea) { font: inherit; color: inherit; letter-spacing: normal; }
#adminApp :where(button) { cursor: pointer; }
#adminApp :where(h1, h2, h3, h4) { font-family: var(--ap-font); letter-spacing: 0; color: var(--ap-text); line-height: 1.25; }
#adminApp :where(a) { color: var(--ap-info-text); }
#adminApp :where(svg) { display: block; }
#adminApp ::selection { background: #315b90; color: #fff; }
#adminApp :focus-visible { outline: 2px solid var(--ap-focus); outline-offset: 2px; }
#adminApp :focus:not(:focus-visible) { outline: none; }
/* Programmatisch fokussierte Ziele (Seitentitel, Dialog-/Drawer-Fläche) ohne Ring – max-base.css setzt ihn mit !important. */
#adminApp [tabindex="-1"]:focus,
#adminApp [tabindex="-1"]:focus-visible,
#adminApp :is(.ap-input, .ap-select):focus-visible { outline: none !important; }

/* ---------------------------------------------------------------- Töne */
#adminApp .ap-tone-good { --ap-tone: var(--ap-good); --ap-tone-text: var(--ap-good-text); }
#adminApp .ap-tone-warn { --ap-tone: var(--ap-warn); --ap-tone-text: var(--ap-warn-text); }
#adminApp .ap-tone-danger { --ap-tone: var(--ap-danger); --ap-tone-text: var(--ap-danger-text); }
#adminApp .ap-tone-info { --ap-tone: var(--ap-info); --ap-tone-text: var(--ap-info-text); }
#adminApp .ap-tone-gold { --ap-tone: var(--ap-gold); --ap-tone-text: var(--ap-gold-hi); }
#adminApp .ap-tone-community { --ap-tone: var(--ap-community); --ap-tone-text: var(--ap-community-text); }
#adminApp .ap-tone-neutral { --ap-tone: #8c99b6; --ap-tone-text: var(--ap-text-2); }

/* ---------------------------------------------------------------- Rahmen */
#adminApp .ap-shell {
  position: relative;
  display: grid;
  /* Feste Spalte: sonst wächst die implizite auto-Spalte mit Kopfzeile/Seiteninhalt (Handy: rechts abgeschnitten). */
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--ap-top-h) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
}
#adminApp .ap-top {
position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 24px;
  border-bottom: 1px solid var(--ap-line-soft);
  background: var(--ap-bg-2);
}
#adminApp .ap-top::after {
content: "";
  position: absolute;
  left: 24px;
  bottom: -1px;
  width: 56px;
  height: 2px;
  background: var(--ap-info);
  pointer-events: none;
}
#adminApp .ap-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
#adminApp .ap-logo {
flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: #173d53;
  box-shadow: inset 0 0 0 1px #30637d, 0 0 12px rgba(98, 204, 228, .12);
}
#adminApp .ap-brand-title {
font-family: var(--ap-font);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.2;
  letter-spacing: -.025em;
  color: var(--ap-text);
  white-space: nowrap;
}
#adminApp .ap-brand-tag {
font-size: 10px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
  line-height: 1.3;
  padding: 4px 7px;
  border-radius: 6px;
  color: var(--ap-accent-text);
  background: #19304e;
}
#adminApp .ap-top-spacer { flex: 1 1 auto; min-width: 8px; }
#adminApp .ap-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px 0 11px;
  border-radius: 999px;
  border: 1px solid var(--ap-line-soft);
  background: rgba(255, 255, 255, .03);
  color: var(--ap-text-2);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
#adminApp .ap-status-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--ap-muted); }
#adminApp .ap-status.is-good .ap-status-dot { background: var(--ap-good); box-shadow: 0 0 0 3px rgba(46, 229, 157, .16); }
#adminApp .ap-status.is-warn .ap-status-dot { background: var(--ap-warn); box-shadow: 0 0 0 3px rgba(255, 181, 71, .16); }
#adminApp .ap-status.is-danger { color: var(--ap-danger-text); border-color: rgba(255, 77, 94, .3); }
#adminApp .ap-status.is-danger .ap-status-dot { background: var(--ap-danger); box-shadow: 0 0 0 3px rgba(255, 77, 94, .18); }
#adminApp .ap-status.is-loading .ap-status-dot { background: var(--ap-info); animation: apPulse 1.1s ease-in-out infinite; }
#adminApp .ap-top-actions { display: flex; align-items: center; gap: 6px; }
#adminApp .ap-top-btn { height: 36px; }
#adminApp .ap-top-btn.is-busy .ap-spin { display: none; }
#adminApp .ap-top-btn.is-busy .ap-btn-icon { display: inline-flex; animation: apSpin .8s linear infinite; }
#adminApp .ap-top-close { width: 36px; height: 36px; margin-left: 4px; }

#adminApp .ap-menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 60vw;
  height: 40px;
  padding: 0 10px 0 10px;
  border-radius: 11px;
  border: 1px solid var(--ap-line);
  background: var(--ap-raised);
  color: var(--ap-text);
  font-size: 14px;
  font-weight: 600;
}
#adminApp .ap-menu-burger { display: inline-flex; color: var(--ap-info); }
#adminApp .ap-menu-page-icon { font-size: 16px; line-height: 1; }
#adminApp .ap-menu-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adminApp .ap-menu-chev { display: inline-flex; color: var(--ap-muted); transition: transform .2s var(--ap-ease); }
#adminApp.is-menu-open .ap-menu-chev { transform: rotate(180deg); }

#adminApp .ap-body {
  position: relative;
  display: grid;
  grid-template-columns: var(--ap-nav-w) minmax(0, 1fr);
  min-height: 0;
}
#adminApp .ap-nav {
min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 24px 16px 28px;
  border-right: 1px solid var(--ap-line-soft);
  background: var(--ap-bg-2);
  scrollbar-width: thin;
  scrollbar-color: #334760 transparent;
}
#adminApp .ap-nav-scrim { display: none; }
#adminApp .ap-nav-group[data-area=overview] { --ap-nav-color: #62cce4; --ap-nav-text: #a0e1ef; }
#adminApp .ap-nav-group[data-area=money] { --ap-nav-color: #ddb166; --ap-nav-text: #e7c78e; }
#adminApp .ap-nav-group[data-area=players] { --ap-nav-color: #56cda5; --ap-nav-text: #94dabb; }
#adminApp .ap-nav-group[data-area=community] { --ap-nav-color: #b093ea; --ap-nav-text: #cdb4ef; }
#adminApp .ap-nav-group[data-area=ops] { --ap-nav-color: #78a7ef; --ap-nav-text: #accbfa; }
#adminApp .ap-nav-group + .ap-nav-group { margin-top: 20px; }
#adminApp .ap-nav-area {
display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 9px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ap-nav-text, var(--ap-muted));
}
#adminApp .ap-nav-area-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ap-tone); }
#adminApp .ap-nav-item {
position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 54px;
  margin: 2px 0;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ap-text-2);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  transition: background .15s, color .15s, border-color .15s;
}
#adminApp .ap-nav-item:hover { background: rgba(255, 255, 255, .045); color: var(--ap-text); }
#adminApp .ap-nav-item[aria-current=page] {
color: var(--ap-text);
  font-weight: 650;
  border-color: color-mix(in srgb, var(--ap-nav-color, var(--ap-info)) 38%, var(--ap-line-soft));
  background: color-mix(in srgb, var(--ap-nav-color, var(--ap-info)) 18%, var(--ap-bg-2));
}
#adminApp .ap-nav-item[aria-current=page]::before {
content: "";
  position: absolute;
  left: -1px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 3px;
  background: var(--ap-nav-color, var(--ap-info));
  box-shadow: 0 0 9px color-mix(in srgb, var(--ap-nav-color, var(--ap-info)) 38%, transparent);
}
#adminApp .ap-nav-icon {
flex: none;
  display: grid;
  place-items: center;
  width: 20px;
  color: var(--ap-nav-text, var(--ap-muted));
  line-height: 1;
}
#adminApp .ap-nav-item[aria-current=page] .ap-nav-icon { color: var(--ap-nav-text, var(--ap-info-text)); }
#adminApp .ap-nav-label {
display: block;
  min-width: 0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
#adminApp .ap-nav-badge,
#adminApp .ap-menu-badge {
  flex: none;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 11.5px;
  font-weight: 750;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--ap-tone-text);
  background: color-mix(in srgb, var(--ap-tone) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--ap-tone) 34%, transparent);
}
#adminApp .ap-nav-badge.ap-tone-danger,
#adminApp .ap-menu-badge.ap-tone-danger { color: #f2dce0; background: #713c48; border-color: #985766; }
#adminApp .ap-tip {
  position: fixed;
  z-index: 60;
  transform: translateY(-50%);
  padding: 6px 10px;
  border-radius: 8px;
  background: #1f2a47;
  border: 1px solid var(--ap-line);
  color: var(--ap-text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 12px 28px -12px rgba(0, 0, 0, .9);
  pointer-events: none;
}

#adminApp .ap-nav-tools { display: grid; gap: 12px; margin-bottom: 20px; }
#adminApp .ap-nav-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 4px; color: var(--ap-text-2); font-size: 12px; font-weight: 650; }
#adminApp .ap-nav-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: var(--ap-raised); color: var(--ap-muted); font-size: 11px; font-variant-numeric: tabular-nums; }
#adminApp .ap-nav-tools .ap-nav-search { width: 100%; max-width: none; flex: none; }
#adminApp .ap-nav-search-meta { padding: 0 4px; font-size: 12px; color: var(--ap-muted); }
#adminApp .ap-nav-copy { display: grid; gap: 3px; flex: 1 1 auto; min-width: 0; }
#adminApp .ap-nav-description { display: block; font-size: 10.5px; line-height: 1.35; font-weight: 400; color: var(--ap-muted); overflow-wrap: anywhere; }
#adminApp .ap-nav-item[aria-current=page] .ap-nav-description { color: #b0bfcf; }
#adminApp .ap-nav-empty { display: grid; justify-items: start; gap: 12px; padding: 14px 6px; color: var(--ap-text-2); font-size: 13px; overflow-wrap: anywhere; }

#adminApp .ap-context { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; width: 100%; max-width: 1360px; padding: 20px var(--ap-pad) 18px; margin: 0 auto; border-bottom: 1px solid var(--ap-line-soft); }
#adminApp .ap-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; color: var(--ap-muted); font-size: 12px; }
#adminApp .ap-breadcrumb button { display: inline-flex; align-items: center; gap: 6px; padding: 3px 0; border: 0; background: transparent; color: var(--ap-text-2); font-size: inherit; }
#adminApp .ap-breadcrumb button:hover { color: var(--ap-info-text); }
#adminApp .ap-breadcrumb [aria-current=page] { color: var(--ap-text); font-weight: 600; }
#adminApp .ap-context-tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; max-width: 100%; }
#adminApp .ap-context-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 32px; padding: 6px 10px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--ap-muted); font-size: 12px; font-weight: 500; line-height: 1.4; }
#adminApp .ap-context-tabs button:hover { background: var(--ap-surface); color: var(--ap-text); }
#adminApp .ap-context-tabs button[aria-current=page] { background: #182e49; border-color: #2b4665; color: var(--ap-accent-text); }

#adminApp .ap-main {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 170, 220, .22) transparent;
}
#adminApp .ap-main-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 24px var(--ap-pad) 72px;
}
#adminApp .ap-page {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  outline: none;
  animation: apPageIn .22s var(--ap-ease);
}
#adminApp .ap-page > * { min-width: 0; }
#adminApp .ap-page[data-area=overview] { --ap-area: var(--ap-info); }
#adminApp .ap-page[data-area=money] { --ap-area: var(--ap-gold); }
#adminApp .ap-page[data-area=players] { --ap-area: var(--ap-good); }
#adminApp .ap-page[data-area=community] { --ap-area: var(--ap-community); }
#adminApp .ap-page[data-area=ops] { --ap-area: #78a7ef; }

/* ---------------------------------------------------------------- Seitenkopf & Abschnitte */
#adminApp .ap-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 24px;
  margin-bottom: 4px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--ap-area, var(--ap-info)) 24%, var(--ap-line-soft));
  border-left: 3px solid color-mix(in srgb, var(--ap-area, var(--ap-info)) 70%, var(--ap-surface));
  border-radius: var(--ap-r-lg);
  background: linear-gradient(110deg, color-mix(in srgb, var(--ap-area, var(--ap-info)) 16%, var(--ap-surface)), color-mix(in srgb, var(--ap-area, var(--ap-info)) 5%, var(--ap-surface)));
}
#adminApp .ap-page-titles { min-width: 0; flex: 1 1 320px; }
#adminApp .ap-eyebrow {
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ap-area, var(--ap-muted));
}
#adminApp .ap-page-title {
font-family: var(--ap-font);
  font-weight: 700;
  font-size: clamp(25px, 2.2vw, 31px);
  line-height: 1.2;
  letter-spacing: -.035em;
  color: var(--ap-text);
  overflow-wrap: anywhere;
  outline: none;
}
#adminApp .ap-page-desc { margin-top: 8px; max-width: 72ch; color: var(--ap-text-2); font-size: 14px; }
#adminApp .ap-page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

#adminApp .ap-section { min-width: 0; }
#adminApp .ap-page > .ap-section { margin-top: 8px; }
#adminApp .ap-section-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 12px; min-height: 30px; }
#adminApp .ap-section-titles { min-width: 0; flex: 1 1 auto; }
#adminApp .ap-section-title {
display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.015em;
  color: var(--ap-text);
}
#adminApp .ap-section-sub { margin-top: 4px; font-size: 13px; color: var(--ap-muted); }
#adminApp .ap-section-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#adminApp .ap-section-count {
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 11.5px;
  letter-spacing: 0;
  color: var(--ap-tone-text);
  background: color-mix(in srgb, var(--ap-tone) 16%, transparent);
  font-variant-numeric: tabular-nums;
}
#adminApp .ap-section-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}
#adminApp .ap-section-toggle:hover { color: var(--ap-text); background: rgba(255, 255, 255, .04); }
#adminApp .ap-section-chev { display: inline-flex; transition: transform .2s var(--ap-ease); }
#adminApp .ap-section.is-open .ap-section-chev { transform: rotate(90deg); }
#adminApp .ap-section.is-collapsible:not(.is-open) .ap-section-head { margin-bottom: 0; }
#adminApp .ap-section.is-collapsible { padding: 14px 16px; border: 1px solid var(--ap-line-soft); border-radius: var(--ap-r-lg); }
#adminApp .ap-section.is-collapsible.is-open { border-style: solid; background: rgba(255, 255, 255, .012); }
#adminApp .ap-section.is-collapsible.ap-tone-danger { border-color: rgba(255, 77, 94, .3); }

/* ---------------------------------------------------------------- Karten, KPIs, Raster */
#adminApp .ap-card {
  position: relative;
  min-width: 0;
  border-radius: var(--ap-r-lg);
  border: 1px solid var(--ap-line-soft);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow);
}
#adminApp .ap-card.has-tone {
  border-color: color-mix(in srgb, var(--ap-tone) 30%, var(--ap-line-soft));
  background: color-mix(in srgb, var(--ap-tone) 12%, var(--ap-surface));
}
#adminApp .ap-card.has-tone::before {
content: "";
  position: absolute;
  left: 20px;
  top: -1px;
  width: 48px;
  height: 2px;
  border-radius: 2px;
  background: var(--ap-tone);
  box-shadow: 0 0 8px color-mix(in srgb, var(--ap-tone) 30%, transparent);
  opacity: .9;
}
#adminApp .ap-card-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; padding: 22px 22px 0; }
#adminApp .ap-card-titles { min-width: 0; flex: 1 1 200px; }
#adminApp .ap-card-title { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 650; line-height: 1.4; color: var(--ap-text); }
#adminApp .ap-card-icon { display: inline-flex; color: var(--ap-tone-text, var(--ap-info)); }
#adminApp .ap-card-sub { margin-top: 3px; font-size: 13px; color: var(--ap-muted); }
#adminApp .ap-card-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
#adminApp .ap-card-body { padding: 20px 22px 22px; min-width: 0; }
#adminApp .ap-card-head + .ap-card-body { padding-top: 14px; }
#adminApp .ap-card.is-flush > .ap-card-body { padding: 8px 0 4px; }
#adminApp .ap-card.is-flush > .ap-card-head + .ap-card-body { padding-top: 10px; }

#adminApp .ap-grid {
  display: grid;
  gap: var(--ap-gap);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, max(var(--ap-min, 210px), (100% - (var(--ap-cols, 4) - 1) * var(--ap-gap)) / var(--ap-cols, 4))), 1fr));
  min-width: 0;
}
#adminApp .ap-grid.is-tpl { grid-template-columns: var(--ap-tpl); }
/* Raster reagieren auf die Breite ihres Bereichs (Seite, Karte, Abschnitt, Drawer), nicht auf das Fenster:
   4er-Raster springen 4 → 2 → 1 statt 3 + Waise. */
#adminApp :is(.ap-page, .ap-card-body, .ap-section-body, .ap-drawer-body) { container-type: inline-size; }
@container (max-width: 899px) {
  #adminApp .ap-grid.ap-c4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #adminApp .ap-grid.ap-c5, #adminApp .ap-grid.ap-c6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #adminApp .ap-grid.is-tpl { grid-template-columns: minmax(0, 1fr); }
}
@container (max-width: 599px) {
  #adminApp .ap-grid.ap-c3 { grid-template-columns: minmax(0, 1fr); }
  #adminApp .ap-grid.ap-c5, #adminApp .ap-grid.ap-c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container (max-width: 339px) {
  #adminApp .ap-grid:is(.ap-c2, .ap-c4, .ap-c5, .ap-c6) { grid-template-columns: minmax(0, 1fr); }
}
#adminApp .ap-game-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 10px; background: var(--ap-sunk); }
#adminApp .ap-game-thumb.is-fallback {
  display: grid;
  place-items: center;
  font-family: var(--ap-font-display);
  font-weight: 800;
  font-size: 34px;
  color: rgba(255, 255, 255, .85);
  background: radial-gradient(120% 90% at 20% 0%, hsl(var(--ap-av-h, 220) 45% 34%), hsl(var(--ap-av-h, 220) 40% 14%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}
#adminApp .ap-game-thumb.is-sm { width: 44px; height: 44px; aspect-ratio: auto; border-radius: 10px; font-size: 18px; flex: none; }

#adminApp .ap-kpi {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding: 20px;
  border-radius: var(--ap-r-lg);
  border: 1px solid var(--ap-line-soft);
  background: color-mix(in srgb, var(--ap-tone, var(--ap-info)) 12%, var(--ap-surface));
  box-shadow: var(--ap-shadow);
  color: var(--ap-text);
  text-align: left;
  font: inherit;
}
#adminApp .ap-kpi-value, #adminApp .ap-kpi-sub { display: block; }
#adminApp .ap-kpi.is-link { cursor: pointer; transition: border-color .15s, transform .15s, background .15s; }
#adminApp .ap-kpi.is-link:hover { border-color: color-mix(in srgb, var(--ap-tone, var(--ap-info)) 45%, var(--ap-line)); transform: translateY(-1px); }
#adminApp .ap-kpi-label {
display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ap-text-2);
}
#adminApp .ap-kpi-label::before {
content: "";
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ap-tone, var(--ap-muted));
  box-shadow: 0 0 6px color-mix(in srgb, var(--ap-tone, var(--ap-muted)) 30%, transparent);
}
#adminApp .ap-kpi-icon { display: inline-flex; }
#adminApp .ap-kpi-value {
  font-family: var(--ap-font-display);
  font-weight: 650;
  font-size: 29px;
  line-height: 1.2;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  /* Wert bleibt eine Zeile (Zahl und ⬥ per NBSP verbunden, kein Umbruch mitten in den Ziffern);
     passt er nicht in die Kachel, verkleinert admin-core.js kpi() die Schrift (fitValue). */
  white-space: nowrap;
  overflow-wrap: normal;
  color: var(--ap-text);
}
#adminApp .ap-kpi.ap-tone-good .ap-kpi-value { color: var(--ap-good); }
#adminApp .ap-kpi.ap-tone-danger .ap-kpi-value { color: var(--ap-danger-text); }
#adminApp .ap-kpi.ap-tone-warn .ap-kpi-value { color: var(--ap-warn-text); }
#adminApp .ap-kpi.ap-tone-gold .ap-kpi-value { color: var(--ap-gold-hi); }
#adminApp .ap-kpi.ap-tone-info .ap-kpi-value { color: var(--ap-info-text); }
#adminApp .ap-kpi.ap-tone-community .ap-kpi-value { color: var(--ap-community-text); }
#adminApp .ap-kpi-value.is-pulse { animation: apValue .9s var(--ap-ease); }
#adminApp .ap-kpi-sub { font-size: 12.5px; color: var(--ap-text-2); }

/* ---------------------------------------------------------------- Badges, Pillen, Meter, Liste */
#adminApp .ap-badge,
#adminApp .ap-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
  font-variant-numeric: tabular-nums;
  color: var(--ap-tone-text, var(--ap-text-2));
  background: color-mix(in srgb, var(--ap-tone, #8c99b6) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--ap-tone, #8c99b6) 28%, transparent);
}
#adminApp .ap-pill { height: 24px; padding: 0 10px 0 8px; }
#adminApp .ap-pill-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--ap-tone, var(--ap-muted)); }
#adminApp .ap-pill.is-pulse .ap-pill-dot { animation: apPulse 1.6s ease-in-out infinite; }

#adminApp .ap-meter { position: relative; height: 8px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .06); box-shadow: inset 0 1px 2px rgba(0, 0, 0, .35); }
#adminApp .ap-meter-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, color-mix(in srgb, var(--ap-tone) 70%, #000), var(--ap-tone));
  box-shadow: none;
  transition: width .6s var(--ap-ease);
}

#adminApp .ap-dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px 20px; }
#adminApp .ap-dl-row { min-width: 0; }
#adminApp .ap-dl dt { font-size: 12px; font-weight: 500; color: var(--ap-muted); }
#adminApp .ap-dl dd { margin-top: 3px; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; color: var(--ap-text); }
#adminApp .ap-dl dd[class*=ap-tone-] { color: var(--ap-tone-text); }

/* ---------------------------------------------------------------- Knöpfe */
#adminApp .ap-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s, filter .15s;
}
#adminApp .ap-btn:active:not(:disabled) { transform: translateY(1px); }
#adminApp .ap-btn:disabled { cursor: not-allowed; opacity: .5; }
#adminApp .ap-btn.is-busy { cursor: progress; opacity: 1; }
#adminApp .ap-btn-icon { display: inline-flex; flex: none; }
#adminApp .ap-btn-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#adminApp .ap-spin {
  display: none;
  flex: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-right-color: transparent;
  animation: apSpin .7s linear infinite;
}
#adminApp .ap-btn.is-busy .ap-spin { display: inline-block; }
#adminApp .ap-btn.is-busy .ap-btn-icon { display: none; }
#adminApp .ap-btn-sm { height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; gap: 6px; }
#adminApp .ap-btn-lg { height: 46px; padding: 0 22px; border-radius: 12px; font-size: 15px; }
#adminApp .ap-btn.is-icon { width: 38px; padding: 0; }
#adminApp .ap-btn-sm.is-icon { width: 32px; }
#adminApp .ap-btn-lg.is-icon { width: 46px; }

#adminApp .ap-btn-primary {
color: #fff;
  background: var(--ap-accent);
  border-color: var(--ap-accent);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .12), 0 0 14px rgba(50, 106, 217, .2);
}
#adminApp .ap-btn-primary:hover:not(:disabled) {
background: var(--ap-accent-hover);
  border-color: var(--ap-accent-hover);
}
#adminApp .ap-btn-secondary { color: var(--ap-text); background: var(--ap-raised); border-color: var(--ap-line); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
#adminApp .ap-btn-secondary:hover:not(:disabled) { background: #233a56; border-color: #46617f; }
#adminApp .ap-btn-ghost { color: var(--ap-text-2); background: transparent; }
#adminApp .ap-btn-ghost:hover:not(:disabled) { color: var(--ap-text); background: rgba(255, 255, 255, .055); }
#adminApp .ap-btn-danger { color: var(--ap-danger-text); background: rgba(255, 77, 94, .09); border-color: rgba(255, 77, 94, .34); }
#adminApp .ap-btn-danger:hover:not(:disabled) { background: rgba(255, 77, 94, .16); border-color: rgba(255, 77, 94, .55); }
#adminApp .ap-btn-danger.is-solid { color: #fff; background: #884755; border-color: #ad6977; box-shadow: none; }
#adminApp .ap-btn-danger.is-solid:hover:not(:disabled) { color: #fff; background: #995462; border-color: #be7e8b; }
#adminApp .ap-btn-success { color: var(--ap-good-text); background: rgba(46, 229, 157, .09); border-color: rgba(46, 229, 157, .32); }
#adminApp .ap-btn-success:hover:not(:disabled) { background: rgba(46, 229, 157, .15); border-color: rgba(46, 229, 157, .5); }

/* ---------------------------------------------------------------- Formulare */
#adminApp .ap-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
#adminApp .ap-field.is-inline { flex-direction: row; align-items: center; gap: 10px; }
#adminApp .ap-label { font-size: 13px; font-weight: 600; color: var(--ap-text-2); }
#adminApp .ap-req { color: var(--ap-gold); }
#adminApp .ap-hint { font-size: 12.5px; color: var(--ap-muted); }
#adminApp .ap-field-error { font-size: 12.5px; font-weight: 600; color: var(--ap-danger-text); }
#adminApp .ap-input,
#adminApp .ap-select {
  width: 100%;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--ap-line);
  background-color: var(--ap-sunk);
  color: var(--ap-text);
  font-size: 14px;
  line-height: 1.3;
  box-shadow: none;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
#adminApp .ap-textarea { height: auto; min-height: 92px; padding: 10px 12px; line-height: 1.5; resize: vertical; }
#adminApp .ap-input::placeholder { color: #7a87a4; opacity: 1; }
#adminApp .ap-input:hover:not(:disabled),
#adminApp .ap-select:hover:not(:disabled) { border-color: #36487a; }
#adminApp .ap-input:focus,
#adminApp .ap-select:focus { outline: none; border-color: var(--ap-focus); box-shadow: 0 0 0 3px rgba(114, 199, 242, .16); }
#adminApp .ap-input[aria-invalid=true] { border-color: var(--ap-danger); }
#adminApp .ap-input:disabled,
#adminApp .ap-select:disabled { opacity: .55; cursor: not-allowed; }
#adminApp .ap-input[type=number] { font-variant-numeric: tabular-nums; }
#adminApp .ap-input[type=datetime-local] { color-scheme: dark; }
#adminApp .ap-select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c99b6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 12px;
  cursor: pointer;
}
#adminApp .ap-select option { background: #131c31; color: #f2f5fb; }

#adminApp .ap-toggle { position: relative; display: inline-flex; align-items: center; gap: 12px; min-height: 28px; cursor: pointer; vertical-align: middle; }
#adminApp .ap-toggle-input { position: absolute; left: 0; top: 50%; width: 44px; height: 26px; margin: -13px 0 0; opacity: 0; cursor: pointer; }
#adminApp .ap-toggle-track {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  border: 1px solid var(--ap-line);
  background: #222e4c;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .4);
  transition: background .2s, border-color .2s;
}
#adminApp .ap-toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #c3cde2;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .45);
  transition: transform .22s var(--ap-ease), background .2s;
}
#adminApp .ap-toggle-input:checked + .ap-toggle-track { background: #25795d; border-color: #56bd97; }
#adminApp .ap-toggle-input:checked + .ap-toggle-track .ap-toggle-thumb { transform: translateX(18px); background: #fff; }
#adminApp .ap-toggle-input:focus-visible + .ap-toggle-track { outline: 2px solid var(--ap-focus); outline-offset: 2px; }
#adminApp .ap-toggle-input:disabled + .ap-toggle-track { opacity: .5; }
#adminApp .ap-toggle.is-busy .ap-toggle-thumb { animation: apPulse 1s ease-in-out infinite; }
#adminApp .ap-toggle.is-sm .ap-toggle-track { width: 36px; height: 21px; }
#adminApp .ap-toggle.is-sm .ap-toggle-thumb { width: 15px; height: 15px; }
#adminApp .ap-toggle.is-sm .ap-toggle-input { width: 36px; height: 21px; margin-top: -10px; }
#adminApp .ap-toggle.is-sm .ap-toggle-input:checked + .ap-toggle-track .ap-toggle-thumb { transform: translateX(15px); }
#adminApp .ap-toggle-text { display: flex; flex-direction: column; min-width: 0; }
#adminApp .ap-toggle-label { font-size: 14px; font-weight: 600; color: var(--ap-text); }
#adminApp .ap-toggle-hint { font-size: 12.5px; color: var(--ap-muted); }

#adminApp .ap-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--ap-line-soft);
  background: var(--ap-sunk);
  overflow-x: auto;
  scrollbar-width: none;
}
#adminApp .ap-seg::-webkit-scrollbar { display: none; }
#adminApp .ap-seg-btn {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ap-text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  transition: background .15s, color .15s, box-shadow .15s;
}
#adminApp .ap-seg-btn:hover { color: var(--ap-text); background: rgba(255, 255, 255, .04); }
#adminApp .ap-seg-btn.is-on {
color: var(--ap-accent-text);
  background: #1c3452;
  box-shadow: inset 0 0 0 1px #2b4e75;
}
#adminApp .ap-seg-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  display: inline-grid;
  place-items: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  background: rgba(255, 255, 255, .07);
  color: var(--ap-text-2);
}
#adminApp .ap-seg.is-sm .ap-seg-btn { height: 28px; padding: 0 10px; font-size: 12.5px; }

#adminApp .ap-search { position: relative; display: flex; align-items: center; flex: 1 1 240px; min-width: 0; max-width: 380px; }
#adminApp .ap-search-icon { position: absolute; left: 12px; display: inline-flex; color: var(--ap-muted); pointer-events: none; }
#adminApp .ap-search .ap-input { padding-left: 38px; padding-right: 36px; }
#adminApp .ap-search-input::-webkit-search-cancel-button,
#adminApp .ap-search-input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }
#adminApp .ap-search-clear {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ap-muted);
}
#adminApp .ap-search-clear:hover { color: var(--ap-text); background: rgba(255, 255, 255, .06); }

#adminApp .ap-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; min-width: 0; }
#adminApp .ap-toolbar > .ap-spacer { flex: 1 1 auto; }

/* ---------------------------------------------------------------- Tabellen */
/* style.css setzt global „th, td { white-space: nowrap }“ – im Admin dürfen Zellen umbrechen.
   :where() hält die Spezifität bei (1,0,0), damit .is-nowrap/.ap-num/Seitenklassen weiter greifen. */
#adminApp :where(th, td) { white-space: normal; }
#adminApp .ap-table-wrap { width: 100%; max-width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; }
#adminApp .ap-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
#adminApp .ap-table th {
padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--ap-text-2);
  background: var(--ap-bg-2);
  border-bottom: 1px solid var(--ap-line-soft);
}
#adminApp .ap-table td { padding: 15px 16px; vertical-align: middle; color: var(--ap-text); border-bottom: 1px solid var(--ap-line-soft); background: transparent; }
#adminApp .ap-table tbody tr:last-child td { border-bottom: 0; }
#adminApp .ap-table tbody tr { transition: background .12s; }
#adminApp .ap-table tbody tr:not(.ap-tr-empty):hover td { background: #192b42; }
#adminApp .ap-table tr.is-link { cursor: pointer; }
#adminApp .ap-table tr.is-link:focus-visible { outline: 2px solid var(--ap-focus); outline-offset: -2px; }
#adminApp .ap-table .is-right { text-align: right; font-variant-numeric: tabular-nums; }
#adminApp .ap-table .is-center { text-align: center; }
#adminApp .ap-table .is-nowrap { white-space: nowrap; }
#adminApp .ap-table th.is-right .ap-th-sort { flex-direction: row-reverse; }
#adminApp .ap-table td.is-primary { font-weight: 600; }
#adminApp .ap-th-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: -4px -6px;
  padding: 4px 6px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: inherit;
}
#adminApp .ap-th-sort:hover { color: var(--ap-text); background: rgba(255, 255, 255, .05); }
#adminApp .ap-sort-ind { font-size: 9px; opacity: .7; }
#adminApp th[aria-sort=ascending] .ap-sort-ind,
#adminApp th[aria-sort=descending] .ap-sort-ind { color: var(--ap-info-text); opacity: 1; }
#adminApp .ap-table-wrap.is-dense .ap-table td { padding-top: 8px; padding-bottom: 8px; }
#adminApp .ap-tr-empty td { padding: 4px 0; }
#adminApp .ap-tr-empty .ap-empty { padding: 26px 16px; }

/* ---------------------------------------------------------------- Personen, Links, Kopieren */
#adminApp .ap-avatar {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: var(--ap-av, 32px);
  height: var(--ap-av, 32px);
  overflow: hidden;
  border-radius: calc(var(--ap-av, 32px) * .24);
  background: linear-gradient(150deg, hsl(var(--ap-av-h, 220) 42% 40%), hsl(var(--ap-av-h, 220) 46% 24%));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
  color: #fff;
  font-size: calc(var(--ap-av, 32px) * .42);
  font-weight: 700;
  line-height: 1;
}
#adminApp .ap-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated; }
#adminApp .ap-avatar.has-img .ap-avatar-i { visibility: hidden; }
#adminApp .ap-who { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; vertical-align: middle; }
#adminApp .ap-who-text { display: flex; flex-direction: column; min-width: 0; }
#adminApp .ap-who-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-weight: 600; color: var(--ap-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adminApp .ap-who-sub { font-size: 12.5px; font-weight: 400; color: var(--ap-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adminApp .ap-link { display: inline-flex; align-items: center; gap: 4px; color: var(--ap-info-text); text-decoration: none; overflow-wrap: anywhere; }
#adminApp .ap-link:hover { text-decoration: underline; text-underline-offset: 3px; }
#adminApp .ap-link-ext { display: inline-flex; opacity: .75; }
#adminApp .ap-link-text { color: var(--ap-text-2); overflow-wrap: anywhere; }
#adminApp .ap-copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-width: 0;
  padding: 2px 3px 2px 8px;
  border-radius: 7px;
  border: 1px solid var(--ap-line-soft);
  background: rgba(255, 255, 255, .03);
  vertical-align: middle;
}
#adminApp .ap-copy.is-mono { font-family: var(--ap-mono); font-size: 12.5px; }
#adminApp .ap-copy-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ap-text-2); }
#adminApp .ap-copy-btn { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 6px; background: transparent; color: var(--ap-muted); }
#adminApp .ap-copy-btn:hover { color: var(--ap-info-text); background: rgba(82, 196, 222, .1); }

/* ---------------------------------------------------------------- Zustände: leer, laden, Fehler */
#adminApp .ap-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 34px 16px; text-align: center; color: var(--ap-text-2); }
#adminApp .ap-empty-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 21px;
  color: var(--ap-good-text);
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--ap-line-soft);
}
#adminApp .ap-empty-text { max-width: 46ch; font-size: 14px; }
#adminApp .ap-skel { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
#adminApp .ap-skel-row { display: flex; align-items: center; gap: 12px; }
#adminApp .ap-skel-bar {
  display: block;
  height: 13px;
  border-radius: 7px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .04) 20%, rgba(255, 255, 255, .095) 50%, rgba(255, 255, 255, .04) 80%);
  background-size: 220% 100%;
  animation: apShimmer 1.4s linear infinite;
}
#adminApp .ap-skel-row .ap-skel-bar { flex: 1 1 auto; }
#adminApp .ap-skel-bar.is-avatar { flex: none; width: 30px; height: 30px; border-radius: 8px; }
#adminApp .ap-skel-bar.is-short { flex: 0 0 18%; }
#adminApp .ap-error {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px 14px;
  padding: 16px 18px;
  border-radius: var(--ap-r);
  border: 1px solid rgba(255, 77, 94, .28);
  background: rgba(255, 77, 94, .065);
}
#adminApp .ap-error-icon { display: inline-flex; flex: none; margin-top: 1px; color: var(--ap-danger-text); }
#adminApp .ap-error-text { flex: 1 1 220px; min-width: 0; }
#adminApp .ap-error-title { font-weight: 650; color: var(--ap-text); }
#adminApp .ap-error-msg { margin-top: 2px; font-size: 13px; color: var(--ap-danger-text); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Ebenen: Dialog, Drawer */
#adminApp .ap-layer { position: absolute; inset: 0; z-index: 20; pointer-events: none; }
#adminApp .ap-layer-item { position: absolute; inset: 0; pointer-events: auto; }
#adminApp .ap-layer-item.is-closing { pointer-events: none; }
#adminApp .ap-scrim {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 16, .64);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  animation: apFade .18s ease-out;
}
#adminApp .is-closing .ap-scrim { animation: apFadeOut .18s ease-in forwards; }
#adminApp .ap-dialog-wrap { display: grid; place-items: center; padding: 24px 16px; overflow-y: auto; }
#adminApp .ap-dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  padding: 24px;
  border-radius: 18px;
  border: 1px solid var(--ap-line);
  background: var(--ap-surface);
  box-shadow: var(--ap-shadow-pop);
  outline: none;
  animation: apPop .22s var(--ap-ease);
}
#adminApp .ap-dialog.is-wide { width: min(580px, 100%); }
#adminApp .ap-dialog.is-danger { border-color: rgba(255, 77, 94, .42); }
#adminApp .is-closing .ap-dialog { animation: apPopOut .16s ease-in forwards; }
#adminApp .ap-dialog-title {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-right: 8px;
  font-family: var(--ap-font-display);
  font-weight: 650;
  font-size: 22px;
  line-height: 1.3;
  letter-spacing: -.025em;
}
#adminApp .ap-dialog-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 10px; color: var(--ap-danger-text); background: rgba(255, 77, 94, .12); }
#adminApp .ap-dialog-msg { margin-top: 10px; color: var(--ap-text-2); white-space: pre-line; overflow-wrap: anywhere; }
#adminApp div.ap-dialog-msg { white-space: normal; }
#adminApp .ap-dialog-actions { display: flex; flex-wrap: wrap-reverse; justify-content: flex-end; gap: 10px; margin-top: 24px; }
#adminApp .ap-form { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }
#adminApp .ap-form .ap-dialog-msg { margin-top: 0; }
#adminApp .ap-form .ap-dialog-actions { margin-top: 8px; }
#adminApp .ap-form-error { padding: 10px 12px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--ap-danger-text); background: rgba(255, 77, 94, .08); border: 1px solid rgba(255, 77, 94, .3); }

#adminApp .ap-drawer {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(var(--ap-drawer-w, 540px), 100%);
  border-left: 1px solid var(--ap-line);
  background: var(--ap-bg-2);
  box-shadow: -40px 0 90px -40px rgba(0, 0, 0, .95);
  outline: none;
  animation: apSlideIn .26s var(--ap-ease);
}
#adminApp .is-closing .ap-drawer { animation: apSlideOut .18s ease-in forwards; }
#adminApp .ap-drawer-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 16px 16px 22px; border-bottom: 1px solid var(--ap-line-soft); }
#adminApp .ap-drawer-titles { flex: 1 1 auto; min-width: 0; padding-top: 3px; }
#adminApp .ap-drawer-title { font-family: var(--ap-font); font-weight: 650; font-size: 22px; line-height: 1.3; letter-spacing: -.025em; overflow-wrap: anywhere; }
#adminApp .ap-drawer-sub { margin-top: 4px; font-size: 13px; color: var(--ap-muted); }
#adminApp .ap-drawer-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#adminApp .ap-drawer-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 22px 32px; display: flex; flex-direction: column; gap: 18px; }
#adminApp .ap-drawer-body > * { min-width: 0; }

/* ---------------------------------------------------------------- Toasts */
#adminApp .ap-toasts {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  width: min(380px, calc(100% - 32px));
  pointer-events: none;
}
#adminApp .ap-toast {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 8px 12px 14px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid var(--ap-line);
  background: #17213a;
  box-shadow: var(--ap-shadow-pop);
  color: var(--ap-text);
  font-size: 14px;
  pointer-events: auto;
  animation: apToastIn .24s var(--ap-ease);
}
#adminApp .ap-toast::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--ap-tone); }
#adminApp .ap-toast.is-leaving { animation: apFadeOut .18s ease-in forwards; }
#adminApp .ap-toast-icon { flex: none; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; color: var(--ap-tone-text); background: color-mix(in srgb, var(--ap-tone) 18%, transparent); }
#adminApp .ap-toast-msg { flex: 1 1 auto; min-width: 0; padding-top: 1px; overflow-wrap: anywhere; }
#adminApp .ap-toast-close { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border: 0; border-radius: 7px; background: transparent; color: var(--ap-muted); }
#adminApp .ap-toast-close:hover { color: var(--ap-text); background: rgba(255, 255, 255, .06); }

/* ---------------------------------------------------------------- Hilfsklassen für Seiten */
#adminApp .ap-sr { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }
#adminApp .ap-muted { color: var(--ap-muted); }
#adminApp .ap-soft { color: var(--ap-text-2); }
#adminApp .ap-pos { color: var(--ap-good); }
#adminApp .ap-neg { color: var(--ap-danger-text); }
#adminApp .ap-gold { color: var(--ap-gold-hi); }
#adminApp .ap-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
#adminApp .ap-mono { font-family: var(--ap-mono); font-size: .92em; }
#adminApp .ap-small { font-size: 12.5px; }
#adminApp .ap-strong { font-weight: 650; color: var(--ap-text); }
#adminApp .ap-truncate { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#adminApp .ap-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
#adminApp .ap-stack { display: flex; flex-direction: column; gap: var(--ap-gap); min-width: 0; }
#adminApp .ap-spacer { flex: 1 1 auto; }
#adminApp .ap-divider { height: 1px; border: 0; margin: 4px 0; background: var(--ap-line-soft); }
#adminApp .ap-list { list-style: none; display: flex; flex-direction: column; }
#adminApp .ap-list > li + li { border-top: 1px solid var(--ap-line-soft); }

/* ---------------------------------------------------------------- Kompakte, beschriftete Seitenleiste */
@media (min-width: 701px) and (max-width: 1099px) {
  #adminApp { --ap-nav-w: 224px; --ap-pad: 22px; --ap-gap: 14px; }
  #adminApp .ap-nav { padding: 20px 12px 24px; }
  #adminApp .ap-nav-item { gap: 8px; padding: 9px 8px; }
  #adminApp .ap-nav-area { padding-left: 8px; }
  #adminApp .ap-nav-description { font-size: 10px; }
  #adminApp .ap-top { padding: 0 20px; }
  #adminApp .ap-context { align-items: flex-start; flex-direction: column; }
}

/* ---------------------------------------------------------------- Handy (≤ 700 px) */
@media (max-width: 700px) {
  #adminApp { --ap-top-h: 60px; --ap-pad: 16px; --ap-gap: 12px; }
  #adminApp .ap-top { gap: 8px; padding: 0 10px 0 12px; }
  #adminApp .ap-brand { display: none; }
  #adminApp .ap-menu-btn { display: inline-flex; flex: 0 1 auto; }
  #adminApp .ap-top-spacer { min-width: 0; }
  #adminApp .ap-status { width: 34px; height: 34px; padding: 0; justify-content: center; border-radius: 10px; }
  #adminApp .ap-status-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #adminApp .ap-top-actions { gap: 2px; }
  #adminApp .ap-top-btn { width: 38px; padding: 0; }
  #adminApp .ap-top-btn .ap-btn-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  #adminApp .ap-top-close { margin-left: 2px; }

  #adminApp .ap-body { grid-template-columns: minmax(0, 1fr); }
  #adminApp .ap-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 5;
    max-height: min(80dvh, calc(100dvh - var(--ap-top-h) - 24px));
    padding: 10px 12px 16px;
    border-right: 0;
    border-bottom: 1px solid var(--ap-line);
    border-radius: 0 0 18px 18px;
    background: var(--ap-bg-2);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .95);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity .18s, transform .22s var(--ap-ease), visibility 0s linear .22s;
  }
  #adminApp.is-menu-open .ap-nav { opacity: 1; visibility: visible; transform: none; transition: opacity .18s, transform .22s var(--ap-ease), visibility 0s; }
  #adminApp .ap-nav-scrim { display: block; position: absolute; inset: 0; z-index: 4; background: rgba(4, 7, 16, .6); opacity: 0; visibility: hidden; transition: opacity .18s, visibility 0s linear .18s; }
  #adminApp.is-menu-open .ap-nav-scrim { opacity: 1; visibility: visible; transition: opacity .18s, visibility 0s; }
  #adminApp .ap-nav-group { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  #adminApp .ap-nav-group + .ap-nav-group { margin-top: 10px; padding-top: 0; border-top: 0; }
  #adminApp .ap-nav-area { grid-column: 1 / -1; position: static; height: auto; padding: 4px 6px 2px; }
  #adminApp .ap-nav-area-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
  #adminApp .ap-nav-area-dot { display: inline-block; }
  #adminApp .ap-nav-item { justify-content: flex-start; height: auto; min-height: 52px; padding: 9px 10px; gap: 10px; margin: 0; background: rgba(255, 255, 255, .03); }
  #adminApp .ap-nav-icon { width: 20px; font-size: 17px; }
  #adminApp .ap-nav-label { font-size: 13.5px; }
  #adminApp .ap-nav-badge { position: static; min-width: 20px; height: 18px; font-size: 11px; }
  #adminApp .ap-nav-item[aria-current=page]::before { top: 10px; bottom: 10px; }
  #adminApp .ap-tip { display: none !important; }

  #adminApp .ap-main-inner { padding: 18px var(--ap-pad) 64px; }
  #adminApp .ap-context { gap: 12px; padding: 16px var(--ap-pad); }
  #adminApp .ap-context-tabs { gap: 4px; }
  #adminApp .ap-context-tabs button { padding: 6px 8px; }
  #adminApp .ap-nav-tools { margin: 8px 0 14px; gap: 10px; }
  #adminApp .ap-nav-description { font-size: 11px; }
  #adminApp .ap-page { gap: 16px; }
  #adminApp .ap-page-title { font-size: 26px; }
  #adminApp .ap-page-head { gap: 12px; padding: 16px; }
  #adminApp .ap-page-actions { width: 100%; }
  #adminApp .ap-card-head { padding: 16px 16px 0; }
  #adminApp .ap-card-body { padding: 14px 16px 16px; }
  #adminApp .ap-card.is-flush > .ap-card-body { padding: 6px 0 2px; }
  #adminApp .ap-kpi { padding: 14px 14px 15px; }
  #adminApp .ap-kpi-value { font-size: 24px; }
  #adminApp .ap-grid { --ap-min: 150px; }
  #adminApp .ap-search { max-width: none; flex-basis: 100%; }
  #adminApp .ap-section.is-collapsible { padding: 12px; }

  /* Tabellen als Karten */
  #adminApp .ap-table-cards .ap-table,
  #adminApp .ap-table-cards .ap-table tbody,
  #adminApp .ap-table-cards .ap-table tr,
  #adminApp .ap-table-cards .ap-table td { display: block; width: 100%; }
  #adminApp .ap-table-cards .ap-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  #adminApp .ap-table-cards .ap-table tbody { display: flex; flex-direction: column; gap: 10px; }
  #adminApp .ap-card.is-flush .ap-table-cards .ap-table tbody { padding: 4px 12px 12px; }
  #adminApp .ap-table-cards .ap-table tr {
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--ap-line-soft);
    background: rgba(255, 255, 255, .025);
  }
  #adminApp .ap-table-cards .ap-table tr.ap-tr-empty { padding: 0; border: 0; background: transparent; }
  #adminApp .ap-table-cards .ap-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 30px;
    padding: 5px 0;
    text-align: right;
    border: 0;
  }
  #adminApp .ap-table-cards .ap-table td::before {
    content: attr(data-label);
    flex: none;
    max-width: 45%;
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--ap-muted);
  }
  #adminApp .ap-table-cards .ap-table td > * { min-width: 0; }
  #adminApp .ap-table-cards .ap-table td.is-primary { justify-content: flex-start; text-align: left; font-size: 15px; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid var(--ap-line-soft); }
  #adminApp .ap-table-cards .ap-table td.is-primary::before,
  #adminApp .ap-table-cards .ap-table tr.ap-tr-empty td::before { display: none; }
  #adminApp .ap-table-cards .ap-table tbody tr:not(.ap-tr-empty):hover td { background: transparent; }
  #adminApp .ap-table-cards .ap-table tr.is-link:active { background: rgba(255, 255, 255, .05); }

  #adminApp .ap-dialog { padding: 20px; border-radius: 16px; }
  #adminApp .ap-dialog-actions .ap-btn { flex: 1 1 140px; }
  #adminApp .ap-drawer { top: 12px; width: 100%; border-left: 0; border-top: 1px solid var(--ap-line); border-radius: 18px 18px 0 0; animation-name: apSlideUp; }
  #adminApp .is-closing .ap-drawer { animation-name: apSlideDown; }
  #adminApp .ap-drawer-head { padding: 14px 10px 12px 16px; }
  #adminApp .ap-drawer-body { padding: 16px 16px 28px; }
  #adminApp .ap-toasts { left: 16px; right: 16px; bottom: 16px; width: auto; }
}

/* Auf sehr schmalen Handys bleibt neben den Werkzeugen ein lesbarer Menütitel. */
@media (max-width: 380px) {
  #adminApp .ap-top { gap: 6px; padding: 0 8px; }
  #adminApp .ap-menu-btn { gap: 4px; padding: 0 6px; font-size: 13px; }
  #adminApp :is(.ap-menu-burger, .ap-menu-page-icon) svg { width: 14px; height: 14px; }
  #adminApp .ap-menu-chev svg { width: 12px; height: 12px; }
  #adminApp .ap-menu-badge { min-width: 18px; padding: 0 5px; font-size: 10.5px; }
  #adminApp .ap-status { flex: none; width: 30px; height: 32px; }
  #adminApp .ap-top :is(.ap-top-btn, .ap-top-close) { width: 32px; height: 36px; }
}

/* ---------------------------------------------------------------- Bewegung */
@keyframes apSpin { to { transform: rotate(360deg); } }
@keyframes apPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes apShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes apFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes apFadeOut { to { opacity: 0; } }
@keyframes apPageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes apPop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes apPopOut { to { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes apSlideIn { from { transform: translateX(36px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes apSlideOut { to { transform: translateX(36px); opacity: 0; } }
@keyframes apSlideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes apSlideDown { to { transform: translateY(40px); opacity: 0; } }
@keyframes apToastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes apValue { 0% { opacity: .65; } 100% { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  #adminApp *, #adminApp *::before, #adminApp *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  #adminApp .ap-skel-bar { animation: none !important; background: rgba(255, 255, 255, .06); }
}

/* ---------------------------------------------------------------- Altschichten überstimmen
   style.css / studio.css / immersive.css / admin-refresh.css setzen Felder und Tabellen unter
   #adminOverlay mit !important. Nur die betroffenen Eigenschaften hier gezielt zurückholen. */
#adminOverlay #adminApp :is(.ap-input, .ap-select) {
  background-color: var(--ap-sunk) !important;
  border: 1px solid var(--ap-line) !important;
  border-radius: 10px !important;
  color: var(--ap-text) !important;
  box-shadow: none !important;
  min-height: 0 !important;
  font-size: 14px !important;
}
#adminOverlay #adminApp .ap-input:not(.ap-textarea) { height: 40px !important; padding: 0 12px !important; }
#adminOverlay #adminApp .ap-textarea { padding: 10px 12px !important; }
#adminOverlay #adminApp .ap-search .ap-input { padding-left: 38px !important; padding-right: 36px !important; }
#adminOverlay #adminApp .ap-select {
  height: 40px !important;
  padding: 0 36px 0 12px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c99b6' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 12px center !important;
  background-size: 12px 12px !important;
}
#adminOverlay #adminApp :is(.ap-input, .ap-select):focus { border-color: var(--ap-focus) !important; box-shadow: 0 0 0 3px rgba(114, 199, 242, .16) !important; }
#adminOverlay #adminApp .ap-input[aria-invalid=true] { border-color: var(--ap-danger) !important; }
#adminOverlay #adminApp .ap-input::placeholder { color: #7a87a4 !important; }
#adminOverlay #adminApp .ap-table { font-size: 13.5px !important; }
#adminOverlay #adminApp .ap-table th { padding: 12px 16px !important; background: var(--ap-bg-2) !important; color: var(--ap-text-2) !important; font-size: 12px !important; border-color: var(--ap-line-soft) !important; }
#adminOverlay #adminApp .ap-table td { padding: 15px 16px !important; border-color: var(--ap-line-soft) !important; }
#adminOverlay #adminApp .ap-table-wrap.is-dense .ap-table td { padding-top: 8px !important; padding-bottom: 8px !important; }
#adminOverlay #adminApp .ap-tr-empty td { padding: 4px 0 !important; }
@media (max-width: 700px) {
  #adminOverlay #adminApp .ap-table-cards .ap-table td { padding: 5px 0 !important; border: 0 !important; }
  #adminOverlay #adminApp .ap-table-cards .ap-table td.is-primary { padding: 2px 0 8px !important; border-bottom: 1px solid var(--ap-line-soft) !important; }
  #adminOverlay #adminApp .ap-table-cards .ap-tr-empty td { padding: 0 !important; }
}
