/* ════════════════════════════════════════════════════════════════════════
   PARTIX-PIM — App Stylesheet
   Glassmorphism / Aurora Design System mit Light/Dark Mode
   Copyright (c) 2026 doppeltplus GmbH
   ══════════════════════════════════════════════════════════════════════ */

:root {
  --accent: #E52721;
  --accent-light: #F26764;
  --accent-dark: #A01D18;
  --accent-glow: rgba(229, 39, 33, 0.4);

  --success: #10b981;
  --warning: #f59e0b;
  --danger:  #ef4444;
  --info:    #3b82f6;
  --purple:  #a855f7;

  --radius: 4px;
  --radius-sm: 4px;
  --radius-lg: 4px;
  --blur: 16px;

  --t-fast: 0.15s ease;
  --t-base: 0.25s ease;

  --sb-w: 240px;
  --sb-w-collapsed: 64px;

  /* Legacy variable aliases for existing inline styles */
  --ac: var(--accent);
  --bg: var(--bg-base);
  --cd: var(--glass-bg);
  --cb: var(--glass-border);
  --mm: var(--text-muted);
  --dm: var(--text-dim);

  /* Card-Background-Alias (viele Inline-Styles in Views nutzen das) —
     v1.62.36: jetzt opak via --surface statt transparent --glass-bg-strong.
     Cards/Dropdowns/Popover die durchschimmerten haben jetzt einen festen
     Hintergrund. Wer absichtlich Glass-Look will: --glass-bg-strong direkt. */
  --card-bg: var(--surface, #131826);

  /* v1.62.36: Opake Surface-Layer für Dropdowns, Popover, Notification-Panels.
     Glas/Transparenz ist für Cards im Body OK, aber Aufpopper über Content
     sollen den Inhalt darunter NICHT durchschimmern lassen. Theme-Werte
     unten in [data-theme="dark"] / [data-theme="light"]. */
}

[data-theme="dark"] {
  --bg-base:     #0a0e1a;
  --bg-aurora-1: rgba(229, 39, 33, 0.18);
  --bg-aurora-2: rgba(168, 85, 247, 0.15);
  --bg-aurora-3: rgba(16, 185, 129, 0.12);

  /* Glass-Layer aufgehellt für besseren Modal-/Card-Kontrast.
     Vorher: 0.06/0.09/0.12 → Modals waren auf dunklem Aurora-Hintergrund kaum
     vom Body unterscheidbar, Text-Inhalte gingen optisch unter.
     Jetzt: 0.10/0.14/0.18 → klarer Layer-Bruch, Modals heben sich ab. */
  --glass-bg:       rgba(255, 255, 255, 0.10);
  --glass-bg-hover: rgba(255, 255, 255, 0.14);
  --glass-bg-strong: rgba(255, 255, 255, 0.18);
  --glass-border:   rgba(255, 255, 255, 0.22);
  --glass-border-strong: rgba(255, 255, 255, 0.32);

  /* Text-Skala neu kalibriert für WCAG-AA-Konformität AUF Glass-Backgrounds:
     - --text       #f1f5f9 auf #0a0e1a   = 16.5:1  AAA primär
     - --text-muted #cbd5e1 auf glass-bg  = ~10:1   AAA secondary
     - --text-dim   #94a3b8 auf glass-bg  = ~5.5:1  AA   tertiary
     Vorher: text-dim war #64748b → ~3.8:1 auf Glass — UNTER AA.
     Wer wirklich extra-dim braucht: var(--text-dim) reicht jetzt;
     dunkler nicht mehr verwenden. */
  --text:        #f1f5f9;
  --text-muted:  #cbd5e1;
  --text-dim:    #94a3b8;

  --shadow-glow: 0 8px 32px rgba(0, 0, 0, 0.4);

  --input-bg: rgba(0, 0, 0, 0.25);
  --code-bg:  rgba(0, 0, 0, 0.3);

  /* Modals: opaker Hintergrund — soll NICHT durchscheinen wie Cards.
     Auf Glass durchscheinend wäre Body-Aurora sichtbar = visuelles Chaos.
     Dunkles Solid mit leichtem Tint vom Body. */
  --modal-bg: #131826;

  /* v1.62.36: opake Surface-Layer */
  --surface:        #131826;
  --surface-hover:  #1f2536;
  --surface-2:      #0f1421;
}

[data-theme="light"] {
  --bg-base:     #f1f5f9;
  --bg-aurora-1: rgba(229, 39, 33, 0.20);
  --bg-aurora-2: rgba(168, 85, 247, 0.15);
  --bg-aurora-3: rgba(16, 185, 129, 0.15);

  /* Light-Glass: weiß mit höheren Alpha-Werten — Modals sollen klar
     vom Body unterscheidbar sein, kein "verschwimmen" */
  --glass-bg:       rgba(255, 255, 255, 0.78);
  --glass-bg-hover: rgba(255, 255, 255, 0.92);
  --glass-bg-strong: rgba(255, 255, 255, 0.98);
  --glass-border:   rgba(15, 23, 42, 0.14);
  --glass-border-strong: rgba(15, 23, 42, 0.24);

  /* Text-Skala für Light-Theme:
     - --text       #0f172a auf glass-bg = 17:1   AAA primär
     - --text-muted #334155 auf glass-bg = 9.5:1  AAA secondary
     - --text-dim   #475569 auf glass-bg = 7:1    AAA tertiary
     Vorher: text-dim war #64748b → 4.7:1 — knapp AA, aber auf hellen
     Aurora-Backgrounds (transparent über Body) konnte das auf ~3:1 fallen. */
  --text:        #0f172a;
  --text-muted:  #334155;
  --text-dim:    #475569;

  --shadow-glow: 0 8px 32px rgba(15, 23, 42, 0.10);

  --input-bg: rgba(255, 255, 255, 0.85);
  --code-bg:  rgba(15, 23, 42, 0.06);

  /* Modal-Hintergrund Light — fast vollopak weiß für klaren Layer-Bruch */
  --modal-bg: #ffffff;

  /* v1.62.36: opake Surface-Layer fürs Light-Theme */
  --surface:        #ffffff;
  --surface-hover:  #f1f5f9;
  --surface-2:      #f8fafc;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Saira", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--bg-base);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  transition: background var(--t-base), color var(--t-base);
  font-size: 14px;
}
body::before {
  content: '';
  position: fixed;
  inset: -50%;
  background:
    radial-gradient(ellipse 800px 600px at 15% 25%, var(--bg-aurora-1), transparent 60%),
    radial-gradient(ellipse 700px 500px at 85% 70%, var(--bg-aurora-2), transparent 60%),
    radial-gradient(ellipse 600px 600px at 50% 100%, var(--bg-aurora-3), transparent 60%);
  z-index: -1;
  animation: aurora 30s ease-in-out infinite alternate;
  pointer-events: none;
}
@keyframes aurora {
  0%   { transform: translate(0, 0) rotate(0deg); }
  50%  { transform: translate(2%, -2%) rotate(2deg); }
  100% { transform: translate(-2%, 1%) rotate(-1deg); }
}

/* ═══ Layout ═══ */
.app {
  display: grid;
  grid-template-columns: var(--sb-w) 1fr;
  min-height: 100vh;
}
[data-sb="collapsed"] .app { grid-template-columns: var(--sb-w-collapsed) 1fr; }

/* ═══ Sidebar ═══ */
#sb {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border-right: 1px solid var(--glass-border);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 50;
  transition: transform var(--t-base);
}
.sb-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  margin-bottom: 10px;
}
.sb-logo .li {
  width: 34px; height: 34px;
  border-radius:4px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px;
  box-shadow: 0 4px 12px var(--accent-glow);
  flex-shrink: 0;
}
.sb-logo .lbl { font-weight: 700; font-size: 14px; color: var(--text); letter-spacing: 0.3px; }
.sb-logo .sub { font-size: 9.5px; color: var(--text-dim); letter-spacing: 1.2px; text-transform: uppercase; }

.sb-section {
  font-size: 9.5px;
  color: var(--text-dim);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 14px 4px;
  font-weight: 600;
}

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

/* Main nav rows */
.nav-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.nav-row:hover { background: var(--glass-bg-hover); color: var(--text); }
.nav-row.act {
  background: rgba(229, 39, 33, 0.13);
  color: var(--accent);
  font-weight: 600;
}
.nav-row.act::before {
  content: '';
  position: absolute;
  left: -12px; top: 8px; bottom: 8px;
  width: 3px;
  background: var(--accent);
  border-radius: 0 4px 4px 0;
  box-shadow: 0 0 8px var(--accent-glow);
}
.nav-inner { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 0; }
.nav-inner .ico { width: 16px; text-align: center; font-size: 13px; flex-shrink: 0; }
.nav-row .nav-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exp-ico {
  font-size: 9px;
  transition: transform var(--t-fast);
  color: var(--text-dim);
  flex-shrink: 0;
}
.exp-ico.exp-op { transform: rotate(90deg); }

/* Submenu */
.sub-wrap {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--t-base);
  padding-left: 16px;
}
.sub-wrap.sub-open { max-height: 500px; padding: 4px 0 4px 16px; }
.sub-it {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
  transition: all var(--t-fast);
}
.sub-it:hover { background: var(--glass-bg-hover); color: var(--text); }
.sub-it.sub-act { background: rgba(229, 39, 33, 0.10); color: var(--accent); }
.sub-it .ico { width: 14px; text-align: center; font-size: 11px; }
.sub-it .lbl { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Sidebar badge */
.bnav, .badge-nav {
  font-size: 10px;
  padding: 1px 7px;
  border-radius:4px;
  background: rgba(229, 39, 33, 0.2);
  color: var(--accent);
  font-weight: 600;
}
.bnav.w { background: rgba(245, 158, 11, 0.2); color: var(--warning); }
.bnav.r { background: rgba(239, 68, 68, 0.2); color: var(--danger); }

/* Sidebar user */
.sb-user {
  margin-top: auto;
  padding: 12px 10px 4px;
  border-top: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sb-user .avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--purple));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 12px;
  flex-shrink: 0;
}

/* ═══ Main area ═══ */
.main {
  padding: 18px 24px 28px;
  overflow-x: hidden;
  min-width: 0;
}

/* Header */
.hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 14px;
  flex-wrap: wrap;
}
.hdr-title h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.hdr-title .crumbs {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.hdr-title .crumbs i { font-size: 9px; opacity: 0.5; }
.hdr-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* Mobile burger */
.burger {
  display: none;
  width: 36px; height: 36px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius:4px;
  color: var(--text-muted);
  align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

/* Search */
.search-wrap { position: relative; }
.search-wrap i.s-ico {
  position: absolute;
  left: 13px; top: 50%; transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 12px;
  pointer-events: none;
}
.search-box {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius:4px;
  padding: 8px 14px 8px 36px;
  color: var(--text);
  font-size: 13px;
  width: 220px;
  font-family: inherit;
}
.search-box::placeholder { color: var(--text-dim); }
.search-box:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }

/* Input-Wrap mit voranstehendem Icon (Lupe etc.) — `<div class="iw"><i><input class="inp"></div>` */
.iw {
  position: relative;
  display: block;
}
.iw > i:first-child {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-dim);
  font-size: 12px;
  pointer-events: none;
  z-index: 1;
}
.iw > .inp,
.iw > input {
  padding-left: 30px;
}

/* Theme toggle / icons */
.icon-btn {
  width: 36px; height: 36px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius:4px;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all var(--t-fast);
  font-size: 14px;
}
.icon-btn:hover { color: var(--accent); border-color: var(--glass-border-strong); }

/* ═══ Cards ═══ */
.card, .glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow);
  transition: border-color var(--t-base);
  padding: 18px 22px;
}
.card:hover, .glass-card:hover { border-color: var(--glass-border-strong); }
.card.compact, .glass-card.compact { padding: 12px 16px; }
.card.tight, .glass-card.tight { padding: 0; overflow: hidden; }

.pt { font-size: 18px; font-weight: 700; color: var(--text); margin: 0; }
.ps { font-size: 12.5px; color: var(--text-muted); margin: 0; }

/* ═══ Buttons ═══ */
/* ═══ Buttons ═══
   v1.62.36: Höhe abgestimmt mit .inp damit Toolbar-Layouts (Button neben
   Select neben Input) keine Wackler haben. Berechnung:
     padding 7px V + 14px H, font 12.5px line-height 1.4 → ~33px Gesamthöhe
   Identisch zu .inp unten. */
.btn {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius:4px;
  padding: 7px 14px;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.4;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  font-family: inherit;
  transition: all var(--t-fast);
  /* Vertikale Mitte mit anderen Form-Elementen — verhindert Baseline-Shift */
  vertical-align: middle;
  white-space: nowrap;
}
.btn:hover { border-color: var(--glass-border-strong); background: var(--glass-bg-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn i { font-size: 11px; }

.btn-a, .btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  border-color: transparent;
  color: white;
  box-shadow: 0 4px 14px var(--accent-glow);
}
.btn-a:hover, .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px var(--accent-glow);
  background: linear-gradient(135deg, var(--accent-light), var(--accent));
}
.btn-g { /* "ghost" — alias */ }
.btn-success {
  background: linear-gradient(135deg, var(--success), #059669);
  border-color: transparent;
  color: white;
}
.btn-warn {
  background: linear-gradient(135deg, var(--warning), #d97706);
  border-color: transparent;
  color: white;
}
.btn-danger {
  background: linear-gradient(135deg, var(--danger), #b91c1c);
  border-color: transparent;
  color: white;
}
.btn.sm { padding: 4px 10px; font-size: 11px; line-height: 1.4; }
.btn.lg { padding: 10px 18px; font-size: 14px; line-height: 1.4; }

/* ═══ Inputs ═══
   v1.62.36: padding 7px V + 12px H, font 12.5px line-height 1.4 + border 1px
   → pixelgleich mit .btn. Auch .inp.sm + .inp.lg ergänzt damit Toolbar-Layouts
   konsistent sind. Plus: native <input>/<select>/<textarea> ohne .inp-Klasse
   bekommen jetzt auch das Skin — kein „unstyled fallback" mehr. */
.inp,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="search"], input[type="date"],
input[type="time"], input[type="datetime-local"], input[type="url"], input[type="tel"],
select, textarea {
  background: var(--input-bg);
  border: 1px solid var(--glass-border);
  border-radius:4px;
  padding: 7px 12px;
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.4;
  font-family: inherit;
  vertical-align: middle;
  transition: all var(--t-fast);
}
/* Größenvarianten — die gibt es jetzt auch für Inputs (vorher nur Buttons) */
.inp.sm,
input.sm, select.sm, textarea.sm { padding: 4px 10px; font-size: 11px; line-height: 1.4; }
.inp.lg,
input.lg, select.lg, textarea.lg { padding: 10px 14px; font-size: 14px; line-height: 1.4; }

.inp:focus,
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.inp::placeholder, input::placeholder, textarea::placeholder { color: var(--text-dim); }
textarea, textarea.inp { resize: vertical; min-height: 60px; }

/* Checkbox & Radio sind keine "boxen" — keine Padding-Vereinheitlichung,
   nur subtle Akzentfarbe + Cursor. */
input[type="checkbox"], input[type="radio"] {
  accent-color: var(--accent);
  cursor: pointer;
  vertical-align: middle;
}

/* Native <select>: Browser-Default-Pfeil entfernen, eigener SVG-Pfeil rein.
   Sieht im Dark-Theme sauberer aus und ist konsistent mit den Buttons. */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='%23e6e8eb' d='M1 3l4 4 4-4z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 9px center;
  padding-right: 26px;
}
[data-theme="light"] select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'><path fill='%23334155' d='M1 3l4 4 4-4z'/></svg>");
}
select option {
  background: var(--card-bg);
  color: var(--text);
}

/* Toolbar-Pattern: stehen Buttons + Inputs nebeneinander, sollen sie
   exakt Baseline-aligned sein. .toolbar verhindert Subpixel-Wackler. */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.toolbar > * { vertical-align: middle; }

.lbl-f {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  margin-bottom: 5px;
}

/* ═══ Stat tiles ═══ */
.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

.sc {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  transition: all var(--t-base);
  text-decoration: none;
  color: inherit;
  display: block;
}
.sc:hover { border-color: var(--glass-border-strong); }
.sc.action-tile { cursor: pointer; }
.sc.action-tile:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  background: var(--glass-bg-hover);
}
.sl {
  font-size: 10.5px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.sv {
  font-size: 26px;
  font-weight: 700;
  margin: 6px 0 3px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.8px;
  color: var(--text);
}
.ss {
  font-size: 11px;
  color: var(--text-muted);
}
.mono { font-family: 'Consolas', 'Monaco', 'Courier New', monospace; }

/* ═══ Pagination ═══ */
.pag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 4px;
  flex-wrap: wrap;
  border-top: 1px solid var(--glass-border);
  margin-top: 6px;
}
.pag-btns {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}
.pb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius:4px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
  transition: all var(--t-fast);
}
.pb:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-strong);
}
.pb.act {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.pb.disabled,
.pb[style*="opacity:.35"] {
  cursor: not-allowed;
  pointer-events: none;
}
.pb-gap {
  padding: 0 4px;
  color: var(--text-dim);
  align-self: center;
}

/* Inline <code>-Tags: lesbar machen mit dezenter Background-Pille.
   Vorher waren <code>-Snippets in Modals oft in --text-dim-grau ohne
   Background — bei Aurora-Body kaum lesbar. */
code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.92em;
  background: var(--code-bg);
  color: var(--text);
  padding: 1px 6px;
  border-radius:4px;
  border: 1px solid var(--glass-border);
}
pre code {
  border: none; padding: 0; background: transparent;
}

/* ═══ Tables ═══ */
.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
.tbl thead th {
  text-align: left;
  padding: 10px 14px;
  background: var(--glass-bg-strong);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  backdrop-filter: blur(var(--blur));
}
.tbl tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text);
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background var(--t-fast); }
.tbl tbody tr:hover { background: var(--glass-bg-hover); }

/* ═══ Alerts ═══ */
.alert {
  padding: 12px 16px;
  border-radius:4px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  border: 1px solid;
  backdrop-filter: blur(var(--blur));
}
.alert i:first-child { font-size: 14px; flex-shrink: 0; }
.alert .body { flex: 1; }
.alert a { color: inherit; text-decoration: underline; font-weight: 600; }
.alert-info {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}
[data-theme="light"] .alert-info { color: #1d4ed8; }
.alert-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #fbbf24;
}
[data-theme="light"] .alert-warn { color: #b45309; }
.alert-err {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
}
[data-theme="light"] .alert-err { color: #b91c1c; }
.alert-ok {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}
[data-theme="light"] .alert-ok { color: #047857; }
.alert-purple {
  background: rgba(168, 85, 247, 0.08);
  border-color: rgba(168, 85, 247, 0.25);
  color: #c4b5fd;
}
[data-theme="light"] .alert-purple { color: #6d28d9; }

/* ═══ Modal ═══ */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-bg.show { display: flex; }
.modal-box {
  /* Opaker Background — kein Glass — damit Modal-Inhalt klar lesbar ist
     ohne Body-Aurora-Hintergrund-Durchscheinen */
  background: var(--modal-bg);
  border: 1px solid var(--glass-border-strong);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  padding: 22px 26px;
  max-width: 92vw;
  max-height: 92vh;
  overflow-y: auto;
}

/* Globale Override für alle modal-box-Varianten (mig-, is-, ish-, sap-, …) —
   die nutzen via Inline-Style oft `var(--card-bg)` was visuell zu transparent
   ist. Hier alles was den class-Suffix `-modal-box` hat oder per ID ein
   Modal-Container ist, bekommt opaken Hintergrund. Inline-Background-Styles
   werden mit !important überschrieben. */
[class$="-modal-box"],
[class*="-modal-box "],
.mig-modal-box,
.is-modal-box,
.ish-modal-box {
  background: var(--modal-bg) !important;
  border: 1px solid var(--glass-border-strong) !important;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5) !important;
}

/* Modal-Overlays: Backdrop muss klar dunkel sein — wenn ein Modal direkt
   am Body-Aurora vorbeischwebt, ist das visuell nicht abgegrenzt. */
.mig-modal,
.is-modal,
.ish-modal {
  background: rgba(0, 0, 0, 0.62) !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Inputs in Modals — sichtbarer Border + leicht abgehobener Hintergrund
   damit man die Eingabefelder vom Modal-Background unterscheidet. Das
   --input-bg und der Border muss in Light + Dark passen. */
.modal-box input:not([type="checkbox"]):not([type="radio"]),
.modal-box select,
.modal-box textarea,
[class$="-modal-box"] input:not([type="checkbox"]):not([type="radio"]),
[class$="-modal-box"] select,
[class$="-modal-box"] textarea {
  background: var(--input-bg) !important;
  border: 1px solid var(--glass-border-strong) !important;
  color: var(--text) !important;
}
.modal-box input:focus,
.modal-box select:focus,
.modal-box textarea:focus,
[class$="-modal-box"] input:focus,
[class$="-modal-box"] select:focus,
[class$="-modal-box"] textarea:focus {
  outline: none;
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* ═══ Toast ═══ */
.toast-wrap {
  position: fixed;
  bottom: 20px; right: 20px;
  display: flex; flex-direction: column; gap: 8px;
  z-index: 300;
  max-width: 90vw;
}
.toast {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--blur));
  border: 1px solid var(--glass-border-strong);
  border-radius:4px;
  padding: 11px 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-size: 12.5px;
  display: flex; align-items: center; gap: 10px;
  min-width: 220px;
  animation: toast-in 0.25s ease-out;
}
.toast.ok i { color: var(--success); }
.toast.err i { color: var(--danger); }
.toast.warn i { color: var(--warning); }
@keyframes toast-in { from { transform: translateX(20px); opacity: 0; } }

/* Status badges */
.bdg {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius:4px;
  font-size: 10.5px;
  font-weight: 600;
}
.bdg-ok    { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.bdg-warn  { background: rgba(245, 158, 11, 0.15); color: var(--warning); }
.bdg-err   { background: rgba(239, 68, 68, 0.15); color: var(--danger); }
.bdg-info  { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.bdg-mute  { background: var(--glass-bg-hover); color: var(--text-muted); }
.bdg-purple{ background: rgba(168, 85, 247, 0.15); color: var(--purple); }
.bdg-ac    { background: rgba(229, 39, 33, 0.15); color: var(--accent); }

/* Helpers */
.hidden { display: none !important; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

/* ═══════════════════════════════════════════════════════════════════════
   RESPONSIVE — Mobile + Tablet
   ═══════════════════════════════════════════════════════════════════════ */
@media (max-width: 1100px) {
  .grid4 { grid-template-columns: repeat(2, 1fr); }
  .grid3 { grid-template-columns: repeat(2, 1fr); }
  .search-box { width: 160px; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  #sb {
    position: fixed;
    left: 0; top: 0;
    width: 280px;
    transform: translateX(-100%);
    z-index: 100;
    box-shadow: 8px 0 32px rgba(0,0,0,0.3);
  }
  body[data-mobile-sb="open"] #sb { transform: translateX(0); }
  body[data-mobile-sb="open"]::after {
    content: '';
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 99;
  }
  .burger { display: flex; }
  .main { padding: 14px 16px 24px; }
  .hdr { gap: 10px; }
  .hdr-title h1 { font-size: 20px; }
  .hdr-actions .search-wrap { display: none; }
}
@media (max-width: 640px) {
  .grid4 { grid-template-columns: 1fr 1fr; gap: 8px; }
  .grid3 { grid-template-columns: 1fr; }
  .grid2 { grid-template-columns: 1fr; }
  .sv { font-size: 22px; }
  .sc { padding: 12px 14px; }
  .card, .glass-card { padding: 14px 16px; }
  .hdr-title h1 { font-size: 18px; }
  .hdr-title .crumbs { font-size: 10.5px; }
  .modal-box { padding: 16px 18px; }
}
@media (max-width: 480px) {
  .grid4 { grid-template-columns: 1fr; }
}

/* Tablet portrait optimizations for inventory */
@media (max-width: 1024px) and (pointer: coarse) {
  .btn { padding: 10px 16px; font-size: 13px; }
  .btn.sm { padding: 7px 12px; font-size: 12px; }
  .inp { padding: 10px 14px; font-size: 14px; }
}

/* ═══════════════════════════════════════════════════════════════════
   Shopware-Switcher in der Topbar (v1.62.22)
   ─────────────────────────────────────────────────────────────────── */
.sw-switcher { display: inline-flex; align-items: center; margin-right: 6px; }
.sw-switcher-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px 7px 11px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  transition: border-color .15s, background-color .15s;
  max-width: 240px;
}
.sw-switcher-btn:hover { border-color: var(--ac); background: var(--glass-bg-hover); }
.sw-switcher-btn .sw-switcher-label {
  max-width: 140px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-switcher-btn .sw-switcher-count {
  background: var(--ac);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  line-height: 1.3;
}

.sw-switcher-menu {
  position: absolute;
  top: 42px;
  right: 0;
  width: 320px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 250;
  overflow: hidden;
}
.sw-switcher-head {
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .04em;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg-hover);
}
.sw-switcher-head i { margin-right: 6px; color: var(--ac); }

.sw-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background-color .12s;
  font-size: 12.5px;
}
.sw-switcher-item:last-of-type { border-bottom: none; }
.sw-switcher-item:hover { background: var(--glass-bg-hover); }
.sw-switcher-item.is-active { background: rgba(74,222,128,0.08); border-left: 3px solid #4ade80; padding-left: 11px; cursor: default; }
.sw-switcher-item .sw-switcher-item-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-dim);
  flex-shrink: 0;
}
.sw-switcher-item.is-active .sw-switcher-item-dot { background: #4ade80; box-shadow: 0 0 0 3px rgba(74,222,128,0.2); }
.sw-switcher-item .sw-switcher-item-body { flex: 1; min-width: 0; }
.sw-switcher-item .sw-switcher-item-name {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-switcher-item .sw-switcher-item-url {
  font-size: 10.5px;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sw-switcher-item .sw-switcher-item-meta {
  font-size: 9.5px;
  display: flex;
  gap: 5px;
  align-items: center;
  color: var(--text-dim);
}
.sw-switcher-item .sw-switcher-item-badge {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sw-switcher-item .sw-switcher-item-badge.default { background: rgba(229,39,33,0.15); color: var(--ac); }
.sw-switcher-item .sw-switcher-item-badge.sw5     { background: rgba(251,191,36,0.15); color: #fbbf24; }
.sw-switcher-item .sw-switcher-item-badge.sw6     { background: rgba(96,165,250,0.15); color: #60a5fa; }
.sw-switcher-item .sw-switcher-item-loading {
  margin-left: auto;
  color: var(--ac);
  font-size: 13px;
}
.sw-switcher-foot {
  padding: 8px 14px;
  background: var(--glass-bg-hover);
  border-top: 1px solid var(--glass-border);
}
.sw-switcher-foot-link {
  font-size: 11px;
  color: var(--text-dim);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sw-switcher-foot-link:hover { color: var(--ac); }

.sw-switcher-empty {
  padding: 20px 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-dim);
}
.sw-switcher-empty a { color: var(--ac); text-decoration: none; }
.sw-switcher-empty a:hover { text-decoration: underline; }

/* Disabled state during switching */
.sw-switcher.is-switching .sw-switcher-btn { opacity: .6; pointer-events: none; }

@media (max-width: 768px) {
  .sw-switcher-btn { padding: 6px 8px; }
  .sw-switcher-btn .sw-switcher-label { max-width: 80px; }
  .sw-switcher-menu { width: calc(100vw - 24px); right: -12px; }
}

/* ════════════════════════════════════════════════════════════════════════
   v1.62.39 — Channel-Switcher (Topbar) — Provider-agnostisch
   ════════════════════════════════════════════════════════════════════════ */
.ch-switcher { display: inline-flex; align-items: center; margin-right: 6px; }
.ch-switcher-btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 10px 7px 11px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  transition: border-color .15s, background-color .15s;
  max-width: 260px;
}
.ch-switcher-btn:hover { border-color: #60a5fa; background: var(--glass-bg-hover); }
.ch-switcher-btn .ch-switcher-label {
  max-width: 160px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-switcher-menu {
  position: absolute; top: 42px; right: 0;
  width: 340px;
  background: var(--card-bg);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  z-index: 250;
  overflow: hidden;
}
.ch-switcher-head {
  padding: 10px 14px; font-size: 11px; font-weight: 600;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-bg-hover);
}
.ch-switcher-head i { margin-right: 6px; color: #60a5fa; }
.ch-switcher-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--glass-border);
  cursor: pointer;
  transition: background-color .12s;
  font-size: 12.5px;
}
.ch-switcher-item:last-of-type { border-bottom: none; }
.ch-switcher-item:hover { background: var(--glass-bg-hover); }
.ch-switcher-item.is-active {
  background: rgba(96,165,250,0.10);
  border-left: 3px solid #60a5fa;
  padding-left: 11px;
  cursor: default;
}
.ch-switcher-item-label {
  flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-switcher-item-sub {
  font-size: 10px; color: var(--text-dim); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ch-switcher-pp {
  font-size: 9px; font-weight: 700; letter-spacing: .04em;
  padding: 2px 6px; border-radius: 3px; text-transform: uppercase;
  flex-shrink: 0;
}
.ch-switcher-pp.shopware6 { background: rgba(16,185,129,0.18); color: #34d399; }
.ch-switcher-pp.shopware5 { background: rgba(168,85,247,0.18); color: #c084fc; }
.ch-switcher-pp.shopify   { background: rgba(132,204,22,0.18); color: #a3e635; }
.ch-switcher-pp.temu      { background: rgba(249,115,22,0.18); color: #fb923c; }
.ch-switcher-foot {
  padding: 8px 14px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0,0,0,0.10);
}
.ch-switcher-foot-link {
  font-size: 11px; color: var(--text-muted);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.ch-switcher-foot-link:hover { color: var(--text); }
.ch-switcher.is-switching .ch-switcher-btn { opacity: .6; pointer-events: none; }

/* ════════════════════════════════════════════════════════════════════════
   v1.62.43 — Nested Subgroups in Sidebar
   ════════════════════════════════════════════════════════════════════════ */
.sub-nested-head {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border-left: 2px solid transparent;
}
.sub-nested-head:hover {
  background: var(--glass-bg-hover);
  color: var(--text);
}
.sub-nested-head.sub-act-soft {
  color: var(--text);
  border-left-color: var(--accent);
}
.sub-nested-head .exp-ico {
  transition: transform .15s;
}
.sub-nested-head .exp-ico.exp-op {
  transform: rotate(90deg);
}
