/* ===========================================================================
   Design-Fundament: ruhiges Cockpit in zwei Modi (hell + dunkel), Tiefe durch
   weiche getönte Schatten, feine Borders und gläserne Flächen. EIN Akzent
   (Blau), identisch in beiden Modi. Die Farbwerte stehen je Theme als CSS-
   Variablen; alle Komponenten greifen sie über var(--…) ab, sodass der
   Theme-Wechsel zur Laufzeit ohne Reload wirkt.

   Theme-Strategie:
   - :root              = HELLE Tokens (Basis).
   - prefers-color-scheme: dark + :root:not([data-theme]) → folgt dem System.
   - [data-theme="dark"] / [data-theme="light"] = manueller Override.
   =========================================================================== */

/* Inter, selbst gehostet (kein Font-CDN, deckt sich mit der CSP). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/Inter-Variable.woff2') format('woff2');
}

/* Helles Cockpit (Default/Basis) – gleiche Hierarchie, gleicher Akzent. */
:root {
  --color-bg: #f4f5f8;
  --color-surface: #ffffff;
  --color-surface-raised: #eef0f5;
  --color-border: rgba(15, 22, 41, 0.1);
  --color-border-strong: rgba(15, 22, 41, 0.18);

  --color-fg: #1b1e29;
  --color-muted: #5b6072;
  --color-faint: rgba(90, 96, 115, 0);

  --color-accent: #3f6fe6; /* gleicher Blauton, leicht abgedunkelt für AA auf Hell */
  --color-accent-hover: #345fcf;
  --color-accent-soft: rgba(63, 111, 230, 0.12);
  --color-accent-ring: rgba(63, 111, 230, 0.4);
  --color-on-accent: #ffffff;

  --color-success: #1f9d63;
  --color-warning: #b9791f;
  --color-danger: #d83a3a;
  --color-danger-soft: rgba(216, 58, 58, 0.08);
  --color-danger-border: rgba(216, 58, 58, 0.35);

  /* Filter-Wert für Glass – in beiden Modi identisch. */
  --glass-blur: blur(22px) saturate(180%);

  --glass-bg: rgba(255, 255, 255, 0.65);
  --glass-bg-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-highlight: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 1px 2px rgba(15, 22, 41, 0.06), 0 18px 48px -22px rgba(15, 22, 41, 0.28);

  --aurora-1: rgba(63, 111, 230, 0.16);
  --aurora-2: rgba(31, 157, 99, 0.08);
  --aurora-3: rgba(63, 111, 230, 0.1);

  --shadow-soft: 0 1px 2px rgba(15, 22, 41, 0.06), 0 8px 24px -14px rgba(15, 22, 41, 0.25);
  --shadow-pop: 0 12px 48px -18px rgba(15, 22, 41, 0.3), 0 2px 8px rgba(15, 22, 41, 0.12);

  --scrollbar-thumb: rgba(15, 22, 41, 0.18);

  --staging: #FCE477;
  --radius: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-sm: 0.4rem;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  color-scheme: light;
}

/* Dunkles Cockpit (manueller Override). */
[data-theme='dark'] {
  --color-bg: #0d0f14;
  --color-surface: #14161f;
  --color-surface-raised: #1a1d28;
  --color-border: rgba(255, 255, 255, 0.08);
  --color-border-strong: rgba(255, 255, 255, 0.14);

  --color-fg: #e8eaf0;
  --color-muted: #8a90a3;
  --color-faint: rgba(90, 96, 115, 0);

  --color-accent: #5b8cff;
  --color-accent-hover: #6f9aff;
  --color-accent-soft: rgba(91, 140, 255, 0.14);
  --color-accent-ring: rgba(91, 140, 255, 0.45);
  --color-on-accent: #0a0c12;

  --color-success: #3ecf8e;
  --color-warning: #f5b14c;
  --color-danger: #ff6b6b;
  --color-danger-soft: rgba(255, 107, 107, 0.08);
  --color-danger-border: rgba(255, 107, 107, 0.35);

  --glass-bg: rgba(20, 22, 31, 0.55);
  --glass-bg-strong: rgba(26, 29, 40, 0.66);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 48px -22px rgba(0, 0, 0, 0.7);

  --aurora-1: rgba(91, 140, 255, 0.16);
  --aurora-2: rgba(62, 207, 142, 0.08);
  --aurora-3: rgba(111, 154, 255, 0.07);

  --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
  --shadow-pop: 0 12px 48px -16px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.5);

  --scrollbar-thumb: rgba(255, 255, 255, 0.16);

  color-scheme: dark;
}

/* Folgt dem System, solange nichts manuell gesetzt ist. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0d0f14;
    --color-surface: #14161f;
    --color-surface-raised: #1a1d28;
    --color-border: rgba(255, 255, 255, 0.08);
    --color-border-strong: rgba(255, 255, 255, 0.14);

    --color-fg: #e8eaf0;
    --color-muted: #8a90a3;
    --color-faint: rgba(90, 96, 115, 0);

    --color-accent: #5b8cff;
    --color-accent-hover: #6f9aff;
    --color-accent-soft: rgba(91, 140, 255, 0.14);
    --color-accent-ring: rgba(91, 140, 255, 0.45);
    --color-on-accent: #0a0c12;

    --color-success: #3ecf8e;
    --color-warning: #f5b14c;
    --color-danger: #ff6b6b;
    --color-danger-soft: rgba(255, 107, 107, 0.08);
    --color-danger-border: rgba(255, 107, 107, 0.35);

    --glass-bg: rgba(20, 22, 31, 0.55);
    --glass-bg-strong: rgba(26, 29, 40, 0.66);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-highlight: rgba(255, 255, 255, 0.18);
    --glass-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 18px 48px -22px rgba(0, 0, 0, 0.7);

    --aurora-1: rgba(91, 140, 255, 0.16);
    --aurora-2: rgba(62, 207, 142, 0.08);
    --aurora-3: rgba(111, 154, 255, 0.07);

    --shadow-soft: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px -12px rgba(0, 0, 0, 0.6);
    --shadow-pop: 0 12px 48px -16px rgba(0, 0, 0, 0.7), 0 2px 8px rgba(0, 0, 0, 0.5);

    --scrollbar-thumb: rgba(255, 255, 255, 0.16);

    color-scheme: dark;
  }
}

/* ---------------------------------------------------------------------------
   Alias-Variablen auf die alten Namen, damit bestehende Regeln unverändert
   weiterlaufen. So erbt die ganze App das neue Token-Set, ohne dass jede
   Klasse angefasst werden muss.
   --------------------------------------------------------------------------- */
:root {
  --ink: var(--color-fg);
  --muted: var(--color-muted);
  --line: var(--color-border);
  --line-strong: var(--color-border-strong);
  --bg: var(--color-bg);
  --soft: var(--color-surface-raised);
  --accent: var(--color-accent);
  --accent-hover: var(--color-accent-hover);
  --accent-soft: var(--color-accent-soft);
  --accent-ink: var(--color-accent);
  --accent-text: var(--color-on-accent);
  --text: var(--color-fg);
}

* { box-sizing: border-box; }

/* Liquid-Glass – Web-Approximation: backdrop-blur + sattere Farben, halb-
   transparente Fläche, feiner Rahmen, innerer Lichtrand oben, weicher Schatten. */
.glass {
  position: relative;
  background-color: var(--glass-bg);
  /* Filter-Wert über eine Variable, damit kein Minifier die Leerzeichen
     zwischen den Filterfunktionen entfernt (sonst fiele der Blur aus). */
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  box-shadow:
    inset 0 1px 0 var(--glass-highlight),
    var(--glass-shadow);
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}
.glass-strong { background-color: var(--glass-bg-strong); }

/* Druck-Feedback: interaktive Elemente sacken kurz ein. */
.press { transition: transform 0.14s var(--ease-out); }
.press:active { transform: scale(0.97); }

/* Fallback ohne Transparenz: solide Fläche, kein Blur. */
@media (prefers-reduced-transparency: reduce) {
  .glass {
    background-color: var(--color-surface);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: var(--shadow-soft);
  }
  .glass-strong { background-color: var(--color-surface); }
}
@media (prefers-reduced-motion: reduce) {
  .press { transition: none; }
  .press:active { transform: none; }
}

/* Staging-Warnbanner: bewusst auffaellig, damit Prod/Staging nie verwechselt wird */
.staging-bar {
  background: #1a1a1a; color: #fff; text-align: center;
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 14px; border-bottom: 2px solid var(--staging);
  position: sticky; top: 0; z-index: 50;
}

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, ui-sans-serif, system-ui, sans-serif;
  color: var(--color-fg);
  background-color: var(--color-bg);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv05', 'cv08', 'ss03';
  /* Sanfter Theme-Wechsel: nur Farben, keine Layout-Bewegung. */
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

/* Ruhiges Hintergrund-Leuchten (Aurora) für Tiefe hinter den Glas-Flächen. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(120% 80% at 82% -12%, var(--aurora-1), transparent 55%),
    radial-gradient(90% 65% at -8% 112%, var(--aurora-2), transparent 60%),
    radial-gradient(70% 50% at 50% 50%, var(--aurora-3), transparent 70%);
  transition: background 0.3s var(--ease-out);
}

::selection { background: var(--color-accent-soft); color: var(--color-fg); }

/* Dezente Scrollbars passend zum jeweiligen Theme. */
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }

a { color: inherit; text-decoration: none; }

/* ===========================================================================
   Layout: feste linke Sidebar + Inhaltsbereich rechts.
   Auf schmalen Geräten (<= 900px) klappt die Sidebar als Off-Canvas-Menü ein
   und wird über den Burger-Button in der schlanken oberen Leiste geöffnet.
   =========================================================================== */
.layout { display: flex; min-height: 100vh; min-height: 100dvh; align-items: stretch; }
.content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.brand { font-size: 17px; font-weight: 600; letter-spacing: .02em; display: inline-flex; align-items: center; }
.brand b { font-weight: 600; }
.brand-text > span { color: var(--muted); font-weight: 400; }

/* --- Sidebar ------------------------------------------------------------- */
.sidebar {
  flex: 0 0 240px; width: 240px;
  position: sticky; top: 0; align-self: flex-start;
  height: 100vh; height: 100dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 6px;
  /* Glas-Sidebar: halbtransparente Fläche, Lichtrand, getönter Schatten. */
  background-color: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-right: 1px solid var(--glass-border);
  box-shadow: inset -1px 0 0 var(--glass-highlight);
  padding: 18px 12px 16px; z-index: 40;
  transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.sidebar .brand { flex-direction: column; gap: 8px; align-items: center; text-align: center; width: 100%; padding: 4px 8px 14px; }
.sidebar .brand-logo { margin-right: 0; height: 112px; max-width: 100%; }

/* Suchfeld oben in der Sidebar: rundes Feld, Lupe links innen, Eingabe randlos */
.side-search {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 0 11px; margin-bottom: 6px;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: var(--color-surface); transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
.side-search .nav-ic { width: 16px; height: 16px; opacity: .6; }
.side-search input {
  flex: 1; min-width: 0;
  border: none; background: none; padding: 9px 0; font-size: 14px;
  color: var(--color-fg); border-radius: 0;
}
.side-search input:focus { outline: none; box-shadow: none; }
.side-search input::placeholder { color: var(--color-muted); }
.side-search:focus-within { border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
.side-search:focus-within .nav-ic { opacity: 1; }
.side-search input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav > a {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius); font-size: 14px; color: var(--color-muted);
  transition: color .15s var(--ease-out), background-color .15s var(--ease-out);
}
/* Vertikaler Akzent-Balken links am aktiven Punkt. */
.side-nav > a[aria-current="page"]::before,
.nav-dd[open] > summary::before {
  content: ''; position: absolute; left: 0; top: 50%;
  width: 3px; height: 20px; transform: translateY(-50%);
  border-radius: 999px; background: var(--color-accent);
}
@media (hover: hover) and (pointer: fine) {
  .side-nav > a:hover { background: var(--color-surface-raised); color: var(--color-fg); }
}
.side-nav > a[aria-current="page"] { background: var(--color-surface-raised); color: var(--color-fg); font-weight: 500; }

/* Untermenüs als aufklappbare Gruppen */
.nav-dd { border-radius: var(--radius); }
.nav-dd > summary {
  position: relative;
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius); font-size: 14px; color: var(--color-muted);
  transition: color .15s var(--ease-out), background-color .15s var(--ease-out);
}
.nav-dd > summary::-webkit-details-marker { display: none; }
.nav-dd > summary::after {
  content: ''; margin-left: auto; width: 6px; height: 6px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px); transition: transform .15s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav-dd > summary:hover { background: var(--color-surface-raised); color: var(--color-fg); }
}
.nav-dd[open] > summary { color: var(--color-fg); }
.nav-dd[open] > summary::after { transform: rotate(-135deg) translateY(1px); }
.nav-dd-menu { display: flex; flex-direction: column; gap: 1px; padding: 2px 0 6px 12px; }
.nav-dd-label {
  font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  color: var(--color-muted); padding: 8px 12px 3px;
}
.nav-dd-menu a {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 14px; color: var(--color-muted);
  transition: color .15s var(--ease-out), background-color .15s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .nav-dd-menu a:hover { background: var(--color-surface-raised); color: var(--color-fg); }
}
.nav-dd-menu a[aria-current="page"] { background: var(--color-accent-soft); color: var(--color-accent); font-weight: 500; }

/* Unterer Sidebar-Block: Glocke, Konto, Abmelden */
.side-foot { margin-top: auto; padding-top: 10px; border-top: 1px solid var(--color-border);
  display: flex; flex-direction: column; gap: 2px; }
.side-foot > a, .side-foot .link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius); font-size: 14px; color: var(--color-muted);
  width: 100%; text-align: left;
  transition: color .15s var(--ease-out), background-color .15s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .side-foot > a:hover, .side-foot .link:hover { background: var(--color-surface-raised); color: var(--color-fg); }
}
.side-foot > a[aria-current="page"] { background: var(--color-surface-raised); color: var(--color-fg); font-weight: 500; }
.side-foot .nav-bell-text { flex: 1; min-width: 0; }
.inline { display: inline; margin: 0; }
.link { background: none; border: none; cursor: pointer; font: inherit; padding: 0; }

/* --- Mobile Topbar mit Burger (nur <= 900px sichtbar) -------------------- */
.topbar-mobile {
  display: none; align-items: center; gap: 14px;
  background-color: var(--glass-bg);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: inset 0 -1px 0 var(--glass-highlight);
  padding: 10px 16px; position: sticky; top: 0; z-index: 30;
}
.brand-mobile .brand-logo { height: 56px; margin-right: 9px; }
.nav-toggle { display: flex; flex-direction: column; justify-content: center; gap: 5px;
  width: 40px; height: 40px; padding: 0 9px; background: none; border: 1px solid var(--color-border);
  border-radius: var(--radius); cursor: pointer; flex: 0 0 auto; }
.nav-toggle-bar { display: block; height: 2px; background: var(--color-fg); border-radius: 2px; transition: transform .2s, opacity .2s; }
body.sidebar-open .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
body.sidebar-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
body.sidebar-open .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --- Theme-Umschalter (System / Hell / Dunkel) --------------------------- */
.theme-toggle {
  display: inline-grid; place-items: center; position: relative;
  width: 38px; height: 38px; padding: 0; flex: 0 0 auto;
  border: 1px solid var(--color-border); border-radius: var(--radius);
  background: transparent; color: var(--color-muted); cursor: pointer;
  transition: color .15s var(--ease-out), border-color .15s var(--ease-out), transform .14s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .theme-toggle:hover { border-color: var(--color-border-strong); color: var(--color-fg); }
}
.theme-toggle .nav-ic { grid-area: 1 / 1; width: 18px; height: 18px; opacity: 1; }
/* Standardmäßig nur das Auto-Icon zeigen (kein Modus gesetzt → System). */
.theme-toggle .ic-theme-light, .theme-toggle .ic-theme-dark { display: none; }
[data-theme-mode='light'] .theme-toggle .ic-theme-auto,
[data-theme-mode='light'] .theme-toggle .ic-theme-dark { display: none; }
[data-theme-mode='light'] .theme-toggle .ic-theme-light { display: block; }
[data-theme-mode='dark'] .theme-toggle .ic-theme-auto,
[data-theme-mode='dark'] .theme-toggle .ic-theme-light { display: none; }
[data-theme-mode='dark'] .theme-toggle .ic-theme-dark { display: block; }

/* Schlanke Desktop-Topbar: nimmt nur den Umschalter rechts auf. */
.topbar-desk {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 12px 24px 0; min-height: 0;
}
@media (max-width: 900px) {
  .topbar-desk { display: none; }
  .topbar-mobile { justify-content: space-between; }
  .topbar-mobile .theme-toggle { margin-left: auto; }
}

/* --- Off-Canvas-Backdrop ------------------------------------------------- */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.42); z-index: 39; }

/* Ohne Navigation (Login etc.): Inhalt nimmt die volle Breite. */
.layout-bare .content { display: block; }

@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; height: 100dvh;
    width: 264px; flex-basis: 264px;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .topbar-mobile { display: flex; }
}

.container { max-width: 820px; margin: 0 auto; padding: 40px 24px 80px; width: 100%; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
h1 { font-size: 32px; font-weight: 600; letter-spacing: -.022em; margin: 0; }
h3 { font-weight: 500; font-size: 16px; margin: 22px 0 8px; }

/* Buttons */
.btn {
  display: inline-block; border: 1px solid var(--color-border-strong); border-radius: var(--radius);
  padding: 10px 18px; font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
  text-align: center; background: var(--color-surface); color: var(--color-fg);
  box-shadow: var(--shadow-soft);
  transition: background-color .15s var(--ease-out), color .15s var(--ease-out), border-color .15s var(--ease-out), box-shadow .15s var(--ease-out), transform .14s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .btn:hover { border-color: var(--color-fg); }
}
.btn-primary { background: var(--color-accent); color: var(--color-on-accent); border-color: var(--color-accent); }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }
}
.btn-ghost { background: transparent; color: var(--color-muted); border-color: var(--color-border); box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .btn-ghost:hover { border-color: var(--color-border-strong); color: var(--color-fg); }
}
.btn-danger { background: var(--color-danger-soft); color: var(--color-danger); border-color: var(--color-danger-border); box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
  .btn-danger:hover { border-color: var(--color-danger); }
}
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; white-space: nowrap; }

/* Cards & list */
.card { background-color: var(--glass-bg); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 22px;
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--glass-shadow);
  transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out); }
.list { display: flex; flex-direction: column; gap: 0; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden;
  background: var(--color-surface); }
.row { display: flex; justify-content: space-between; gap: 16px; align-items: center;
  padding: 18px 22px; border-bottom: 1px solid var(--color-border); background: transparent;
  transition: background-color .15s var(--ease-out); }
.row:last-child { border-bottom: none; }
@media (hover: hover) and (pointer: fine) {
  .row:hover { background: var(--color-surface-raised); }
}
.row-top { display: flex; align-items: center; gap: 10px; margin-bottom: 5px; }
.row-name { font-weight: 500; font-size: 16px; }
.row-product { font-size: 14px; margin-top: 2px; }
.order { font-size: 13px; color: var(--muted); }
.row-when { text-align: right; white-space: nowrap; }
.when-date { font-weight: 500; }
.when-time { font-size: 13px; color: var(--muted); }
.when-open { font-size: 14px; }
.empty { text-align: center; color: var(--muted); }

/* To-do "Zu planen" */
.todo-block { margin-bottom: 30px; }
.todo-head, .list-head { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.todo-head .count { font-size: 13px; font-weight: 500; color: var(--color-on-accent); background: var(--color-accent);
  border-radius: 999px; padding: 1px 9px; }
.list-head { margin-top: 4px; }
.todo-block .list { border-color: var(--line-strong); }
.todo-row { border-left: 3px solid var(--accent); }

/* Badges & chips */
.badge { font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--color-border-strong); color: var(--color-muted); }
.badge-offen { border-color: var(--color-warning); color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 12%, transparent); }
.badge-geplant { border-color: var(--color-accent-ring); color: var(--color-accent); background: var(--color-accent-soft); }
.badge-erledigt { border-color: color-mix(in srgb, var(--color-success) 45%, transparent); color: var(--color-success); background: color-mix(in srgb, var(--color-success) 12%, transparent); }
.badge-storniert { border-color: var(--color-border-strong); color: var(--color-muted); background: var(--color-surface-raised); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip { border: 1px solid var(--color-border); background: var(--color-surface); border-radius: 999px;
  padding: 7px 16px; font-size: 14px; font-weight: 400; color: var(--color-muted);
  transition: background-color .15s var(--ease-out), border-color .15s var(--ease-out), color .15s var(--ease-out), transform .14s var(--ease-out); }
@media (hover: hover) and (pointer: fine) {
  .chip:hover { border-color: var(--color-border-strong); color: var(--color-fg); }
}
.chip.active { background: var(--color-accent-soft); color: var(--color-accent); border-color: var(--color-accent-ring); font-weight: 500; }
.chip .count { opacity: .55; font-size: 12px; margin-left: 2px; }
/* Filter-Leiste mit Umschalter rechts */
.chips-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.chips-bar .chips { margin-bottom: 0; }
.chip-toggle { font: inherit; cursor: pointer; line-height: 1.45; }
.chip-toggle strong { font-weight: 600; }
.chip-ico { opacity: .55; margin-right: 4px; }
/* Prio-hoch-Chip mit dezentem Akzent + Punkt */
.chip-prio:not(.active) { border-color: color-mix(in srgb, var(--color-warning) 45%, transparent); color: var(--color-warning); background: color-mix(in srgb, var(--color-warning) 10%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .chip-prio:not(.active):hover { border-color: var(--color-warning); color: var(--color-warning); }
}
.chip-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--color-warning); margin-right: 6px; vertical-align: middle; }
.chip-prio.active { background: var(--color-accent-soft); color: var(--color-accent); border-color: var(--color-accent-ring); }
.chip-prio.active .chip-dot { background: var(--color-accent); }

/* Forms */
.form { display: flex; flex-direction: column; gap: 18px; }
label { display: flex; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 500; color: var(--color-fg); }
input, select, textarea {
  font: inherit; font-size: 15px; padding: 11px 13px; border: 1px solid var(--color-border-strong);
  border-radius: var(--radius); background: var(--color-surface); color: var(--color-fg); width: 100%;
  transition: border-color .15s var(--ease-out), box-shadow .15s var(--ease-out);
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--color-accent); box-shadow: 0 0 0 3px var(--color-accent-soft); }
input::placeholder, textarea::placeholder { color: var(--color-muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; }
.form-actions { display: flex; gap: 12px; margin-top: 6px; }
.danger-form { margin-top: 22px; }

/* Login */
.login-wrap { min-height: 88vh; min-height: 88dvh; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 18px; padding: 34px; }
.login-card form { display: flex; flex-direction: column; gap: 18px; }
.brand-big { font-size: 22px; font-weight: 600; letter-spacing: .02em; text-align: center; }
.brand-big span { color: var(--muted); font-weight: 400; }
.login-card > p.muted { text-align: center; }
.alert { background: var(--color-danger-soft); color: var(--color-danger); padding: 11px 13px; border-radius: var(--radius); font-size: 14px; border: 1px solid var(--color-danger-border); }
.alert-ok { background: color-mix(in srgb, var(--color-success) 10%, transparent); color: var(--color-success); border-color: color-mix(in srgb, var(--color-success) 40%, transparent); }
.muted { color: var(--color-muted); }
.small { font-size: 13px; }

/* 2FA-Einrichtung */
.login-card-wide { max-width: 440px; }
.totp-qr { display: flex; justify-content: center; padding: 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); }
.totp-qr img { display: block; image-rendering: pixelated; }
.totp-manual summary { cursor: pointer; }
.totp-secret { display: inline-block; margin-top: 6px; font-size: 15px; letter-spacing: .08em;
  word-break: break-all; }

.field-hint { margin-top: 2px; }
code { background: var(--color-surface-raised); border: 1px solid var(--color-border); border-radius: 4px; padding: 1px 5px; font-size: 13px; }

/* Produkte-Seite */
.prod-search { display: flex; align-items: center; gap: 14px; margin: 18px 0; }
.prod-search input { flex: 1; }
#prod-count { white-space: nowrap; }
.prod-card { margin-bottom: 12px; padding: 16px 20px; }
.prod-title { font-weight: 500; margin-bottom: 8px; }
.variant-row { flex-direction: row; align-items: center; justify-content: space-between;
  padding: 9px 0; border-top: 1px solid var(--line); font-weight: 400; }
.variant-row:first-of-type { border-top: none; }
.variant-name { font-size: 14px; }
.toggle { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.toggle input { width: auto; }
.toggle-label { font-size: 13px; color: var(--muted); }
.saved { font-size: 12px; color: #1d7a3f; }
.remember-toggle { font-size: 14px; color: var(--ink); margin: 4px 0 16px; }

/* Passkeys / 2FA-Auswahl */
.pk-error { margin: 0; }
.pk-divider { display: flex; align-items: center; text-align: center; color: var(--muted);
  font-size: 13px; gap: 12px; }
.pk-divider::before, .pk-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.choose-list { display: flex; flex-direction: column; gap: 12px; }
.choose-card { display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--bg); cursor: pointer; width: 100%; text-decoration: none; color: inherit;
  font: inherit; transition: border-color .15s, background .15s; }
.choose-card:hover:not(:disabled) { border-color: var(--accent); background: var(--accent-soft); }
.choose-card:disabled { opacity: .6; cursor: default; }
.choose-title { font-size: 15px; font-weight: 600; color: var(--ink); }
.choose-desc { font-size: 13px; color: var(--muted); line-height: 1.4; }
.pk-list { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; }
.pk-item { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-top: 1px solid var(--line); }
.pk-item:first-child { border-top: none; }
.pk-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pk-name { font-size: 14px; font-weight: 600; color: var(--ink); }

/* Userverwaltung */
.user-row { flex-direction: row; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.user-main { min-width: 0; }
.user-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

/* Dashboard / Widgets – vollbreit, untereinander gestapelt */
.widget-stack { display: flex; flex-direction: column; gap: 16px; }
.widget { padding: 20px 22px; }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.widget-title { margin: 0; font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.widget-title .count { font-size: 12px; font-weight: 500; color: var(--color-on-accent); background: var(--color-accent); border-radius: 999px; padding: 1px 9px; }
.widget-more { font-size: 13px; color: var(--muted); white-space: nowrap; }
.widget-more:hover { color: var(--ink); }

/* Unterabschnitte innerhalb eines Widgets (z.B. "Zu planen" / "Nächste") */
.widget-section + .widget-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.widget-subhead { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.widget-subhead .count { font-size: 11px; font-weight: 600; color: var(--muted); background: var(--soft);
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 0 7px; letter-spacing: 0; }

.widget-list { display: flex; flex-direction: column; }
.widget-item { display: flex; align-items: center; gap: 10px; min-height: 40px;
  padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.widget-item:first-child { border-top: none; }
.wi-main { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wi-meta, .widget-item .order, .widget-item .when-date { flex: 0 0 auto; white-space: nowrap; font-size: 13px; }
.druck-wi .druck-check { flex: 0 0 auto; margin: 0; display: flex; }
.druck-wi .check-btn { width: 24px; height: 24px; font-size: 14px; }
.overdue { color: #9a2620; font-weight: 600; }

.quick-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-actions .btn { flex: 1 1 auto; min-width: 140px; }
.stat-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.stat { flex: 1 1 100px; display: flex; flex-direction: column; gap: 3px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color .12s; }
.stat:hover { border-color: var(--accent); }
.stat b { font-size: 26px; font-weight: 600; line-height: 1; }
.stat span { font-size: 12px; color: var(--muted); }

/* Dashboard-Editor */
.widget-editor { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.we-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line); }
.we-row:first-child { border-top: none; }
.we-row .toggle { font-size: 14px; }
.we-actions { display: flex; gap: 6px; flex: 0 0 auto; }

/* 3D-Druck */
.druck-row { gap: 14px; align-items: flex-start; }
.druck-check { margin: 0; flex: 0 0 auto; align-self: center; }
/* Beschrifteter „Erledigt"-Knopf rechts in der Zeile (eigene Klasse, damit das
   Dashboard-Widget .druck-wi .check-btn unberührt bleibt). */
.abhaken-btn { white-space: nowrap; }
.abhaken-btn.checked { color: #1d7a3f; border-color: #bfe0c8; }
/* .check-btn (rundes/eckiges Icon) nur noch im Dashboard-Widget genutzt */
.check-btn { width: 26px; height: 26px; border: 1.5px solid var(--color-border-strong); border-radius: 6px;
  background: var(--color-surface); cursor: pointer; font-size: 15px; line-height: 1; color: #fff;
  display: inline-flex; align-items: center; justify-content: center; transition: all .12s; padding: 0; }
.check-btn:hover { border-color: var(--color-fg); }
.check-btn.checked { background: var(--color-success); border-color: var(--color-success); }
.druck-main { flex: 1; min-width: 0; display: block; }
.druck-row.is-done .row-name { text-decoration: line-through; color: var(--muted); }
.druck-row.is-done { background: var(--soft); }
/* Wird ein offener Auftrag per AJAX abgehakt, bleibt seine Zeile (mit den
   Bedien-Elementen der offenen Ansicht) im DOM und wird nur ans Listenende
   verschoben. Die offen-spezifischen Steuerungen werden dann ausgeblendet,
   damit die Zeile wie eine server-gerenderte Erledigt-Zeile aussieht. */
.druck-row.is-done .drag-handle,
.druck-row.is-done .druck-select,
.druck-row.is-done .prio-set { display: none; }

/* Prioritäts-Schnellschalter pro Zeile (Hoch/Normal/Niedrig) */
.prio-set { flex: 0 0 auto; display: inline-flex; margin: 0; border: 1px solid var(--line-strong);
  border-radius: 6px; overflow: hidden; align-self: center; }
.prio-btn { border: none; background: var(--color-surface); color: var(--color-muted); cursor: pointer; padding: 6px 10px;
  font-size: 12px; line-height: 1; font-family: inherit; border-left: 1px solid var(--color-border);
  transition: background .12s var(--ease-out), color .12s var(--ease-out); white-space: nowrap; }
.prio-btn:first-child { border-left: none; }
.prio-btn:hover { background: var(--color-surface-raised); color: var(--color-fg); }
.prio-btn.active { background: var(--color-accent); color: var(--color-on-accent); font-weight: 500; }
.rekla-open { flex: 0 0 auto; align-self: center; }
.badge-reklamation { border-color: #e3c4c2; color: #9a2620; background: #fdeceb; }

/* Drag-Handle + Mehrfachauswahl der offenen Aufträge */
.druck-offen-sortable .row:last-child { border-bottom: 1px solid var(--line); }
.druck-list > .row.is-done:first-of-type { border-top: none; }
.drag-handle { flex: 0 0 auto; align-self: center; cursor: grab; color: var(--muted);
  font-size: 18px; line-height: 1; padding: 2px 2px; user-select: none;
  touch-action: none; letter-spacing: -1px; }
.drag-handle:active { cursor: grabbing; }
/* Eckige Auswahl-Box für die Mehrfachauswahl (bewusst andere Form als der runde Erledigt-Knopf) */
.druck-select { flex: 0 0 auto; align-self: center; width: 18px; height: 18px;
  margin: 0 2px 0 0; cursor: pointer; accent-color: var(--ink); }
.sortable-ghost { opacity: .45; background: var(--soft); }
.sortable-chosen { background: var(--soft); }

/* Sammel-Leiste (erscheint bei Mehrfachauswahl) */
.druck-bulkbar { position: sticky; bottom: 16px; z-index: 20; margin-top: 16px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--bg); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 10px 14px; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.druck-bulkbar[hidden] { display: none; }
.druck-bulkbar .bulk-count { font-size: 14px; }
.druck-bulkbar .bulk-sep { color: var(--line-strong); }
.druck-bulkbar .bulk-label { font-size: 14px; color: var(--muted); }
.druck-bulkbar .bulk-status { font-size: 13px; font-weight: 500; color: #1d7a3f; margin-left: auto; }
.druck-bulkbar .bulk-status.is-err { color: #9a2620; }

@media (max-width: 560px) {
  .druck-row { flex-wrap: wrap; }
  .prio-set, .rekla-open, .druck-check { margin-left: 40px; }
}

/* Modal (natives <dialog>) – z.B. Reklamations-Freitext */
dialog.modal { border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 0; max-width: 460px;
  width: calc(100% - 32px); background-color: var(--glass-bg-strong);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 var(--glass-highlight), var(--shadow-pop); color: var(--color-fg); }
dialog.modal::backdrop { background: rgba(0,0,0,.42); }
.modal-card { padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.modal-card h3 { margin: 0; font-size: 18px; }
.modal-card label { display: block; font-size: 14px; }
.modal-card textarea { width: 100%; margin-top: 6px; }
.modal-card .form-actions { display: flex; justify-content: flex-end; gap: 10px; margin: 0; }

/* Auto-Druck aus Bestellungen: Alters-Ampel, Vorschläge, Summen-Übersicht */
.ampel { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 10px;
  line-height: 1.4; border: 1px solid transparent; white-space: nowrap; }
.ampel-gruen { background: #e7f6ec; color: #1d7a3f; border-color: #bfe3cb; }
.ampel-gelb  { background: #fdf6e3; color: #8a6d1a; border-color: #ecdca6; }
.ampel-rot   { background: #fdeceb; color: #9a2620; border-color: #e3c4c2; }
.ampel-grau  { background: #f0f0ef; color: #555; border-color: #ddd; }

/* Sendungsverfolgung */
.ship-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.ship-main { min-width: 0; flex: 1; }
.ship-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ship-num { font-variant-numeric: tabular-nums; letter-spacing: .02em; }
.ship-sub, .ship-status, .ship-meta { margin-top: 3px; }
.ship-status { color: var(--text); }
.ship-actions { display: inline-flex; gap: 6px; flex-shrink: 0; }
.ship-src { font-size: 11px; letter-spacing: .02em; text-transform: uppercase;
  border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 6px; color: var(--text); }
.ship-warn { font-size: 12px; font-weight: 700; border: 1px solid #e3c4c2;
  background: #fdeceb; border-radius: 4px; padding: 1px 7px; color: #9a2620; white-space: nowrap; }
/* Problempaket (zu lange unterwegs oder DHL-Problem): Zeile rot hervorheben. */
.ship-problem { background: #fdeceb; border: 1px solid #e3c4c2; border-left: 3px solid #9a2620;
  border-radius: 8px; padding: 10px 12px; }
.teil-add-row { display: flex; gap: 8px; align-items: center; }
.teil-add-row input { flex: 1; }

/* Label-Formular: Maße, Produkt-Radio, Service-Gruppen */
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.radio-row { display: flex; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.radio-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-strong);
  border-radius: 999px; padding: 7px 14px; cursor: pointer; font-size: 14px; }
.radio-pill input { accent-color: #b11; }
.svc-block { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin-top: 12px; }
.svc-block > summary { font-weight: 600; font-size: 14px; cursor: pointer; list-style: revert; }
.svc-block > summary::-webkit-details-marker { display: revert; }
.svc-h { font-weight: 600; font-size: 13px; margin: 4px 0 8px; color: var(--text); }
.svc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; margin-top: 10px; }
.chk { display: flex; align-items: center; gap: 8px; margin: 4px 0; font-size: 14px; flex-wrap: wrap; }
.chk input[type="text"], .chk input[type="email"], .chk input[type="number"], .chk input[type="date"] { flex: 1; min-width: 120px; }
.ident-block, .cod-block { margin-top: 10px; }
.ident-block .grid3, .cod-block .grid3 { margin-top: 6px; gap: 6px; }
@media (max-width: 760px) {
  .grid4 { grid-template-columns: 1fr 1fr; }
  .svc-grid { grid-template-columns: 1fr; }
}

.vorschlag-banner { display: block; margin-bottom: 12px; padding: 10px 14px; border: 1px solid var(--line-strong);
  border-radius: 6px; background: var(--soft); color: var(--ink); text-decoration: none; font-size: 14px; }
.vorschlag-banner:hover { border-color: var(--ink); }
.vorschlag-link { display: inline-block; margin-bottom: 12px; }

.druck-summary { margin-bottom: 14px; padding: 14px 16px; }
.druck-summary > summary { cursor: pointer; font-weight: 500; }
.summary-grid { margin-top: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 18px; }
.summary-row { display: flex; gap: 8px; font-size: 14px; }
.summary-menge { font-weight: 700; min-width: 34px; }
.summary-title { color: var(--muted); }
.summary-supplier { margin-top: 14px; }
.summary-supplier:first-of-type { margin-top: 12px; }
.summary-supplier-name { font-weight: 600; font-size: 14px; }
.summary-supplier .summary-grid { margin-top: 6px; }
@media (max-width: 560px) { .summary-grid { grid-template-columns: 1fr; } }

.order-link { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
.order-link:hover { color: var(--accent-hover); }

/* Druck-Vorschläge: Auswahl-Leiste + nach Bestellung gruppierte Accordions */
.vs-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--soft); margin-bottom: 12px; }
.vs-all-label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 500; }
.vs-all-label input { width: 18px; height: 18px; }

.vs-order { margin-bottom: 10px; padding: 0; overflow: hidden; }
.vs-order-sum { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; }
.vs-order-sum::-webkit-details-marker { display: none; }
.vs-order-sum::before { content: '▸'; color: var(--muted); transition: transform .15s; flex: 0 0 auto; }
.vs-order[open] .vs-order-sum::before { transform: rotate(90deg); }
.vs-order-sum .vs-group { width: 18px; height: 18px; flex: 0 0 auto; }
.vs-order-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.vs-order-no { font-weight: 600; }
.vs-order-items { padding: 4px 16px 14px 50px; border-top: 1px solid var(--line); }
.vs-order-link { display: inline-block; font-size: 13px; margin: 8px 0 4px; }
.vs-item-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.vs-item-row input { width: 18px; height: 18px; flex: 0 0 auto; }
.vs-item-label { cursor: pointer; font-size: 15px; }
.vs-actions { justify-content: flex-start; gap: 10px; position: sticky; bottom: 0;
  background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line); }

/* Bambu-Drucker-Status */
.printer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.printer-card { padding: 16px; display: flex; gap: 14px; align-items: flex-start; }
.printer-card.off { opacity: .7; }
.pc-ico { flex: 0 0 auto; width: 54px; height: 54px; color: var(--line-strong);
  background: var(--soft); border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.pc-ico svg { width: 38px; height: 38px; display: block; }
.printer-card.run .pc-ico { color: #1d7a3f; background: #e7f6ec; }
.printer-card.idle .pc-ico { color: var(--muted); }
.printer-card.off .pc-ico { color: #b8b8b8; }
.pc-body { flex: 1; min-width: 0; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pc-name { font-weight: 600; font-size: 16px; }
.pc-model { margin-top: 1px; }
.pc-state { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap;
  border: 1px solid var(--line-strong); color: var(--muted); }
.pc-state.pc-run { background: #e7f6ec; color: #1d7a3f; border-color: #bfe3cb; }
.pc-state.pc-idle { background: var(--soft); color: var(--muted); }
.pc-state.pc-off { background: #f4f4f4; color: #9a9a9a; }
.pc-bar { height: 7px; background: var(--soft); border-radius: 4px; overflow: hidden; margin: 12px 0 6px; }
.pc-bar span { display: block; height: 100%; background: #1d7a3f; transition: width .4s; }
.pc-prog { font-size: 14px; }
.pc-prog b { font-size: 15px; }
.pc-job { font-size: 13px; color: var(--muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-temps { margin-top: 8px; }
.pc-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; background: var(--line-strong); }
.pc-dot.pc-run { background: #1d7a3f; }
.pc-dot.pc-idle { background: #c9a227; }
.pc-dot.pc-off { background: #c2c2c2; }

/* Postfach / Tickets */
.nav-badge { display: inline-block; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
  background: #9a2620; color: #fff; font-size: 10px; line-height: 16px; text-align: center; vertical-align: middle; }
.ticket-row { gap: 12px; align-items: center; text-decoration: none; color: inherit; }
.tk-dot { flex: 0 0 auto; width: 8px; height: 8px; border-radius: 50%; background: transparent; }
.ticket-row.is-unread .tk-dot { background: #2563c9; }
.ticket-row.is-unread .row-name { font-weight: 700; }
.tk-main { flex: 1; min-width: 0; }
.tk-main .row-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-meta { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.tk-st-offen { background: #fdeceb; color: #9a2620; border-color: #e3c4c2; }
.tk-st-in_arbeit { background: #fdf6e3; color: #8a6d1a; border-color: #ecdca6; }
.tk-st-erledigt { background: #e7f6ec; color: #1d7a3f; border-color: #bfe3cb; }
.tk-title { font-size: 22px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ticket-head { padding: 16px; }
.th-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.th-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.th-controls select { padding: 6px 8px; }
.th-order { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tk-thread { margin: 16px 0; display: flex; flex-direction: column; gap: 14px; }
.tk-msg { display: flex; gap: 10px; align-items: flex-start; }
.tk-msg.out { flex-direction: row-reverse; }
.tk-avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; background: var(--color-surface-raised); color: var(--color-muted); }
.tk-msg.out .tk-avatar { background: var(--color-accent); color: var(--color-on-accent); }
.tk-bubble { flex: 1 1 auto; min-width: 0; max-width: 80%; border: 1px solid var(--color-border); border-radius: 12px;
  padding: 10px 14px; background: var(--color-surface); }
.tk-msg.out .tk-bubble { background: var(--color-surface-raised); border-color: var(--color-border); }
.tk-msg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.tk-msg.out .tk-msg-head { flex-direction: row-reverse; }
.tk-msg-from { font-weight: 600; font-size: 14px; }
.tk-orig { color: var(--muted); text-decoration: underline; }
.tk-text { white-space: pre-wrap; word-wrap: break-word; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.page-head-actions { display: inline-flex; gap: 8px; align-items: center; }

/* Benötigte Teile / Lieferantenbestellungen */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 30px 0 8px; }
.section-head h2 { font-size: 18px; margin: 0; }
.teil-row { gap: 12px; align-items: center; }
.teil-main { flex: 1; min-width: 0; text-decoration: none; color: inherit; display: block; }
.teil-row.teil-geliefert .row-name { color: var(--muted); }
.teil-status { padding: 6px 8px; font-size: 13px; border-radius: 6px; }
.teil-supplier { padding: 6px 8px; font-size: 13px; border-radius: 6px; max-width: 160px; }
.teil-st-offen { border-color: #e3c4c2; }
.teil-st-bestellt { border-color: #ecdca6; background: #fdf6e3; }
.teil-st-geliefert { border-color: #bfe3cb; background: #e7f6ec; color: #1d7a3f; }
.teil-add { margin-top: 12px; }
.supplier-edit { flex: 1; display: flex; gap: 8px; }
.supplier-edit input { flex: 1; }
.lf-products { display: flex; flex-direction: column; gap: 3px; margin-top: 4px; }
.lf-prod { font-size: 14px; }
.lf-qty { font-weight: 700; display: inline-block; min-width: 30px; }
.direkt-add { margin-bottom: 18px; padding: 14px 16px; }
.direkt-add > summary { cursor: pointer; font-weight: 500; }

/* ZM-Media-Logo: Login-Seite (groß, zentriert) + Topbar (klein vor dem Schriftzug) */
.login-logo { display: block; width: 150px; max-width: 60%; height: auto; margin: 0 auto 6px; }
.brand-logo { height: 46px; width: auto; vertical-align: middle; margin-right: 11px; }
.topbar .brand { display: inline-flex; align-items: center; }
.ticket-reply { padding: 16px; }
.ticket-reply textarea { width: 100%; }
@media (max-width: 560px) { .tk-msg.out, .tk-msg.in { margin-left: 0; margin-right: 0; } }

/* Kalender */
.cal-nav { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.cal-month { font-size: 17px; font-weight: 600; min-width: 150px; }
.cal-today { margin-left: auto; }
.cal-card { padding: 12px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-head { margin-bottom: 6px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); padding: 2px 0; }
.cal-grid + .cal-grid { margin-top: 6px; }
.cal-cell { position: relative; min-height: 86px; border: 1px solid var(--color-border); border-radius: 8px;
  padding: 4px 5px; overflow: hidden; background: var(--color-surface); }
.cal-cell.cal-out { background: var(--color-surface-raised); }
.cal-cell.cal-out .cal-daynum { color: var(--muted); opacity: .6; }
.cal-today-cell { border-color: var(--color-accent); box-shadow: inset 0 0 0 1px var(--color-accent); }
.cal-create { position: absolute; inset: 0; z-index: 0; }
.cal-create:hover { background: var(--soft); }
.cal-daynum { position: relative; z-index: 1; font-size: 12px; font-weight: 600; pointer-events: none; }
.cal-chips { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 3px; margin-top: 3px; }
.cal-chip { display: block; font-size: 11px; line-height: 1.3; padding: 2px 5px; border-radius: 5px;
  border: 1px solid transparent; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-chip b { font-weight: 600; }
.chip-geplant { background: #f1f6fd; color: #1857b8; border-color: #c9dcf5; }
.chip-erledigt { background: #f1f9f4; color: #1d7a3f; border-color: #c7e6d2; }

.appt-planned { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }

/* Agenda */
.agenda-day { margin-bottom: 18px; }
.agenda-date { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.agenda-wd { color: var(--muted); font-weight: 500; }

@media (max-width: 560px) {
  .user-row { flex-direction: column; align-items: stretch; }
  .user-actions { justify-content: flex-start; }
  .cal-card { padding: 8px; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 44px; padding: 3px; }
  .cal-chips { flex-direction: row; flex-wrap: wrap; gap: 2px; }
  .cal-chip { width: 7px; height: 7px; padding: 0; font-size: 0; border-radius: 50%; }
  .cal-chip b { font-size: 0; }
  .grid2, .grid3 { grid-template-columns: 1fr; }
  .widget { padding: 16px 16px; }
  .quick-actions .btn { min-width: 0; }
  .page-head { flex-direction: column; align-items: stretch; }
  .container { padding: 28px 18px 64px; }
  .topbar { padding: 14px 18px; }
  .brand { font-size: 15px; white-space: nowrap; }
  .topbar nav { gap: 16px; font-size: 13px; }
  h1 { font-size: 25px; }
  .row { padding: 16px 18px; }
}

/* Hilfslink unter Login-/Passwort-Formularen */
.login-aux { text-align: center; font-size: 14px; margin: 0; }
.login-aux a { color: var(--muted); }
.login-aux a:hover { color: var(--ink); }

/* Glocke in der Navigation */
.nav-bell { position: relative; display: inline-flex; align-items: center; }
.bell-icon { font-size: 16px; filter: grayscale(1); opacity: .8; }
.nav-bell:hover .bell-icon { opacity: 1; }
.bell-badge { position: absolute; top: -7px; right: -9px; min-width: 16px; height: 16px;
  padding: 0 4px; box-sizing: border-box; border-radius: 999px; background: var(--color-accent); color: var(--color-on-accent);
  font-size: 10px; font-weight: 500; line-height: 16px; text-align: center; }

/* Posteingang */
.notif-row { text-decoration: none; color: inherit; }
.notif-main { min-width: 0; }
.notif-row.is-unread { background: var(--soft); }
.notif-dot { display: inline-block; width: 7px; height: 7px; border-radius: 999px;
  background: var(--ink); margin-right: 8px; vertical-align: middle; }
.notif-when { white-space: nowrap; }

/* Abo-Tabelle (Ereignisse abonnieren) */
.abo-table { display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; }
.abo-head, .abo-row { display: grid; grid-template-columns: 1fr 72px 72px; align-items: center;
  gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.abo-row:last-child { border-bottom: none; }
.abo-head { background: var(--soft); font-size: 13px; color: var(--muted); }
.abo-col { text-align: center; justify-self: center; }
.abo-col input { width: auto; }
.abo-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.abo-name { font-weight: 500; font-size: 15px; }

/* Inline-E-Mail-Bearbeitung in der Userverwaltung */
.email-edit { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.email-edit input { width: auto; flex: 1; max-width: 280px; font-size: 14px; padding: 7px 10px; }

/* ===========================================================================
   Zugänglichkeit & Politur (Tastatur-Fokus, Viewport, Bewegung) – monochrom,
   keine optische Änderung am bestehenden Erscheinungsbild.
   =========================================================================== */

/* Sichtbarer Tastatur-Fokus – nur bei Tastaturbedienung, nicht beim Mausklick. */
a:focus-visible, button:focus-visible, summary:focus-visible,
.btn:focus-visible, .chip:focus-visible, .choose-card:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
/* In der Sidebar liegt der Ring enger an (Einträge haben eigene Radien). */
.side-nav a:focus-visible, .nav-dd-menu a:focus-visible, .side-foot a:focus-visible,
.side-foot .link:focus-visible, .nav-dd > summary:focus-visible {
  outline-offset: -2px;
}
/* Programmatisch fokussierter Inhaltsbereich (nach „Zum Inhalt springen") zeigt keinen Ring. */
main:focus { outline: none; }

/* „Zum Inhalt springen" – unsichtbar, bis es per Tastatur fokussiert wird. */
.skip-link {
  position: absolute; left: 12px; top: -52px; z-index: 60;
  background: var(--color-accent); color: var(--color-on-accent); padding: 9px 14px;
  border-radius: var(--radius); font-size: 14px; font-weight: 500;
  transition: top .15s;
}
.skip-link:focus { top: 12px; }

/* Tastenklick-Feedback: Scale auf Druck (Emil-Stil) – reagiert sofort, skaliert Inhalt mit. */
.btn:active { transform: scale(0.97); }

/* Saubere Zeilenumbrüche: keine einzelnen Wörter in der letzten Zeile. */
h1, h3, .widget-title { text-wrap: balance; }
p { text-wrap: pretty; }

/* Weicher Anker-Scroll; respektiert „Bewegung reduzieren" im Betriebssystem. */
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important;
  }
}

/* Navigations-Icons + Konto-Avatar in der Sidebar */
.nav-ic { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
/* Aktiver Punkt: Icon akzentuiert (analog AppShell). */
.side-nav > a[aria-current="page"] .nav-ic, .nav-dd[open] > summary .nav-ic,
.side-foot > a[aria-current="page"] .nav-ic { opacity: 1; color: var(--color-accent); }
.nav-avatar { width: 22px; height: 22px; border-radius: 50%; background: var(--color-accent-soft);
  color: var(--color-accent); display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 600; letter-spacing: .02em; flex: 0 0 auto; }

/* ===========================================================================
   Politur im Emil-Kowalski-Stil – sparsam, nur wo es trägt: kräftigere Easing
   auf vorhandenen Übergängen, Press-Feedback, sanftes Modal. Alles < 300 ms,
   nur transform/opacity; prefers-reduced-motion (oben) neutralisiert die Transforms.
   =========================================================================== */
.chip:active { transform: scale(0.97); }
.row { transition: background-color .12s var(--ease-out); }
.stat { transition: border-color .15s var(--ease-out); }
.choose-card { transition: border-color .15s var(--ease-out), background-color .15s var(--ease-out); }

/* Native <dialog>-Modal: sanftes Aufploppen aus der Mitte + Backdrop-Fade.
   Keyframe statt @starting-style → robust auch ohne neueste Browser (kein „unsichtbares Modal"). */
dialog.modal[open] { animation: modal-pop .18s var(--ease-out); }
dialog.modal[open]::backdrop { animation: modal-backdrop .2s var(--ease-out); }
@keyframes modal-pop { from { opacity: 0; transform: scale(0.96); } }
@keyframes modal-backdrop { from { background: rgba(0,0,0,0); } }

/* ===========================================================================
   Artikel-Detail – Fokus & Hierarchie: eine Leitkennzahl groß, alles andere
   ruhig untergeordnet. Additiv; ändert keine globalen Klassen.
   =========================================================================== */
.stock-hero { display: flex; align-items: flex-end; gap: 38px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 22px; margin-top: 24px; }
.hero-num { font-size: 52px; font-weight: 600; line-height: .92; }
.hero-label { font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--muted); margin-bottom: 5px; }
.stock-breakdown { display: flex; gap: 28px; padding-bottom: 9px; font-size: 13px; color: var(--muted); }
.stock-breakdown > div { display: flex; flex-direction: column; gap: 2px; }
.stock-breakdown b { font-size: 19px; font-weight: 500; line-height: 1.1; color: var(--ink); }
.num-neg { color: #9a2620; }

/* Ruhige Abschnitts-Überschrift statt plakativer h3.list-head. */
.section-label { font-size: 12px; font-weight: 500; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); margin: 0 0 11px; }

/* Kompakte Buchungs-Leiste. */
.book-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--soft); border-radius: var(--radius-lg); padding: 13px 16px; margin-top: 24px; }
.book-bar label { gap: 5px; }
.book-bar input, .book-bar select { font-size: 14px; padding: 8px 11px; }
.book-bar .btn { margin-left: auto; }

/* Meta-Badges unter dem Titel. */
.meta-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 11px; }
.badge-sku { color: var(--accent-ink); background: var(--accent-soft); border-color: #d8e0ff; }
