/* ═══════════════════════════════════════════════════════════
   DESIGN TOKENS — Editorial Industrial Business
═══════════════════════════════════════════════════════════ */
:root {
  /* Color — Light */
  --bg: #faf8f3;
  --bg-tint: #f3f0e8;
  --paper: #ffffff;
  --paper-2: #f7f5ef;
  --border: #e6e2d6;
  --border-strong: #c8c3b3;
  --ink: #14181a;
  --ink-2: #2a2f32;
  --muted: #6b6c66;
  --muted-2: #9b9a91;

  /* Brand + Status */
  --brand: #0a8a8a;
  --brand-dark: #066d6d;
  --brand-darker: #044f4f;
  --brand-soft: #e5f2f2;
  --brand-softer: #f2f9f9;

  --amber: #ad620d;
  --amber-soft: #fdf1df;
  --sage: #1f6b3a;
  --sage-soft: #e9f2ec;
  --rose: #a12a35;
  --rose-soft: #fbeaec;
  --slate: #4a5259;
  --slate-soft: #eef0f2;

  /* Typography */
  --font-display: 'Fraunces', 'Didot', 'Bodoni Moda', Georgia, serif;
  --font-body: 'Public Sans', -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  /* Spacing scale (4px) */
  --s-1: 4px;   --s-2: 8px;   --s-3: 12px;  --s-4: 16px;  --s-5: 20px;
  --s-6: 24px;  --s-7: 32px;  --s-8: 40px;  --s-9: 48px;  --s-10: 64px;

  /* Radius */
  --r-sm: 4px;  --r-md: 8px;  --r-lg: 12px;  --r-xl: 16px;  --r-pill: 999px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(16, 22, 26, 0.04), 0 0 0 1px rgba(16, 22, 26, 0.03);
  --sh-md: 0 2px 6px rgba(16, 22, 26, 0.05), 0 1px 2px rgba(16, 22, 26, 0.04), 0 0 0 1px rgba(16, 22, 26, 0.04);
  --sh-lg: 0 18px 40px -12px rgba(10, 16, 22, 0.18), 0 6px 16px -8px rgba(10, 16, 22, 0.12), 0 0 0 1px rgba(16, 22, 26, 0.04);
  --sh-focus: 0 0 0 3px rgba(10, 138, 138, 0.22);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in: cubic-bezier(0.55, 0, 1, 0.45);
}

/* Dark Theme */
html[data-theme="dark"] {
  --bg: #0c0e0f;
  --bg-tint: #14181a;
  --paper: #161a1c;
  --paper-2: #1c2124;
  --border: #262c31;
  --border-strong: #3a4149;
  --ink: #e9e6dc;
  --ink-2: #c9c6b9;
  --muted: #989588;
  --muted-2: #5f5e54;

  --brand: #2ab3b3;
  --brand-dark: #0a8a8a;
  --brand-soft: rgba(42, 179, 179, 0.12);
  --brand-softer: rgba(42, 179, 179, 0.06);

  --amber: #d08843;
  --amber-soft: rgba(208, 136, 67, 0.12);
  --sage: #3fa863;
  --sage-soft: rgba(63, 168, 99, 0.12);
  --rose: #c9505c;
  --rose-soft: rgba(201, 80, 92, 0.12);
  --slate-soft: rgba(120, 128, 136, 0.12);

  --sh-sm: 0 1px 2px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04);
  --sh-md: 0 2px 6px rgba(0,0,0,0.45), 0 1px 2px rgba(0,0,0,0.3), 0 0 0 1px rgba(255,255,255,0.04);
  --sh-lg: 0 22px 48px -14px rgba(0,0,0,0.7), 0 8px 20px -10px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.06);
  --sh-focus: 0 0 0 3px rgba(42, 179, 179, 0.32);
}

/* ═══════════════════════════════════════════════════════════
   RESET + BASE
═══════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
  max-width: 100vw;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "ss01" 1, "cv11" 1, "cv04" 1;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

::selection { background: var(--brand); color: #fff; }

/* Scrollbar (subtle) */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* Typography utilities */
.font-display { font-family: var(--font-display); font-variation-settings: "opsz" 96, "SOFT" 30, "WONK" 0; }
.font-mono    { font-family: var(--font-mono); font-variation-settings: normal; }
.tnum         { font-variant-numeric: tabular-nums; }
.uppercase-eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   BRAND MARK — Used in login hero + app header
═══════════════════════════════════════════════════════════ */
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 40, "SOFT" 50, "WONK" 0;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-mark-ico {
  width: 34px; height: 34px;
  background: var(--brand);
  color: #fff;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.22) inset, 0 2px 4px rgba(6, 93, 93, 0.28);
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: -0.02em;
  position: relative;
}
.brand-mark-ico::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(255,255,255,0.4);
  border-radius: 6px;
  pointer-events: none;
}
.brand-mark-text { line-height: 1; font-size: 18px; }
.brand-mark-text em {
  display: block;
  font-family: var(--font-body);
  font-style: normal;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 600;
}

/* ═══════════════════════════════════════════════════════════
   LOGIN · Split Editorial Hero
═══════════════════════════════════════════════════════════ */
#login {
  display: none;
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
#login.on { display: grid; }

#login {
  grid-template-columns: 1.1fr 1fr;
}
@media (min-width: 768px) and (max-width: 1099px) {
  /* Tablet: Panel etwas breiter damit lange Baustellen-Labels reinpassen */
  #login { grid-template-columns: 1fr 1.15fr; }
}
@media (min-width: 1100px) {
  /* Desktop: Panel deutlich breiter für lange Customer-Strings */
  #login { grid-template-columns: 1fr 1.25fr; }
}
@media (max-width: 900px) {
  #login { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
}

/* Left — Hero */
.lg-hero {
  position: relative;
  padding: clamp(24px, 4vw, 56px);
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(10, 138, 138, 0.10), transparent 60%),
    radial-gradient(ellipse 90% 70% at 85% 95%, rgba(173, 98, 13, 0.08), transparent 60%),
    var(--bg-tint);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  overflow: hidden;
  border-right: 1px solid var(--border);
}
html[data-theme="dark"] .lg-hero {
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(42, 179, 179, 0.12), transparent 60%),
    radial-gradient(ellipse 90% 70% at 85% 95%, rgba(208, 136, 67, 0.08), transparent 60%),
    var(--bg-tint);
}

/* Grid paper texture */
.lg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(10, 16, 22, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(10, 16, 22, 0.045) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  opacity: 0.55;
  -webkit-mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
          mask-image: linear-gradient(to bottom, black 0%, black 70%, transparent 100%);
}
html[data-theme="dark"] .lg-hero::before {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
}

.lg-hero-top {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 2;
}
.lg-hero-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
  display: flex;
  gap: 10px;
  align-items: center;
}
.lg-hero-meta::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(31, 107, 58, 0.18);
  animation: pulseDot 2.4s ease-in-out infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.lg-headline {
  position: relative;
  z-index: 2;
}
.lg-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--brand-dark);
  text-transform: uppercase;
  margin-bottom: 18px;
  font-weight: 600;
}
html[data-theme="dark"] .lg-eyebrow { color: var(--brand); }

.lg-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 0;
  font-weight: 400;
  font-size: clamp(40px, 6vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--ink);
  max-width: 14ch;
  margin-bottom: 24px;
}
.lg-title em {
  font-style: italic;
  font-variation-settings: "opsz" 144, "SOFT" 80, "WONK" 1;
  color: var(--brand-dark);
}
html[data-theme="dark"] .lg-title em { color: var(--brand); }

.lg-sub {
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 44ch;
  margin-bottom: 0;
}

.lg-features {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
@media (max-width: 700px) {
  .lg-features { grid-template-columns: 1fr; gap: 14px; padding-top: 18px; }
}
.lg-feat {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.lg-feat-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.lg-feat-h {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 20, "SOFT" 30;
  font-size: 19px;
  line-height: 1.15;
  color: var(--ink);
}
.lg-feat-p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

/* Right — Login Panel */
.lg-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(24px, 4vw, 48px);
  position: relative;
  background: var(--paper);
}

.lg-card {
  width: 100%;
  max-width: 460px;
  background: var(--paper);
  border-radius: 14px;
  padding: clamp(24px, 3vw, 36px);
  position: relative;
}
@media (min-width: 768px) {
  .lg-card { max-width: 540px; }
}
@media (min-width: 1100px) {
  .lg-card { max-width: 600px; }
}
.lg-card-hd {
  margin-bottom: 24px;
}
.lg-card-hd .uppercase-eyebrow { margin-bottom: 6px; }
.lg-card h2 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 32, "SOFT" 30;
  font-weight: 500;
  font-size: 28px;
  line-height: 1.1;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.lg-field {
  margin-bottom: 14px;
}
.lg-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.lg-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--paper-2);
  color: var(--ink);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.lg-input::placeholder { color: var(--muted-2); }
.lg-input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--paper);
  box-shadow: var(--sh-focus);
}

.lg-submit {
  width: 100%;
  min-height: 52px;
  margin-top: 6px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: transform .12s var(--ease), background .18s var(--ease), box-shadow .18s var(--ease);
  position: relative;
  overflow: hidden;
}
.lg-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 30%, rgba(255,255,255,0.12) 50%, transparent 70%);
  transform: translateX(-120%);
  transition: transform .6s var(--ease);
}
.lg-submit:hover::before { transform: translateX(120%); }
.lg-submit:hover { background: var(--brand-dark); }
html[data-theme="dark"] .lg-submit { background: var(--brand); color: #0b1516; }
html[data-theme="dark"] .lg-submit:hover { background: #46c2c2; }
.lg-submit:active { transform: translateY(1px); }

.lg-err {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--rose-soft);
  color: var(--rose);
  border-radius: 8px;
  font-size: 13px;
  border: 1px solid rgba(201, 80, 92, 0.28);
  display: block;
  animation: errShake 0.35s var(--ease);
}
.lg-err:empty { display: none; }
@keyframes errShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  40% { transform: translateX(4px); }
  60% { transform: translateX(-2px); }
  80% { transform: translateX(2px); }
}

.lg-help-row {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 10px;
}
.lg-help-row a {
  color: var(--brand-dark);
  font-weight: 600;
  border-bottom: 1px solid currentColor;
}
html[data-theme="dark"] .lg-help-row a { color: var(--brand); }

/* ─── Landing Footer (v3.0) ─── */
.lg-footer {
  grid-column: 1 / -1;
  margin-top: 60px;
  padding: 38px 28px 22px;
  background: linear-gradient(180deg, rgba(10,138,138,0.04), rgba(10,138,138,0.10));
  border-top: 1px solid var(--border);
  border-radius: 28px 28px 22px 22px;
  color: var(--muted);
}
html[data-theme="dark"] .lg-footer {
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(10,138,138,0.10));
}
.lg-footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
  max-width: 1200px;
  margin: 0 auto;
}
.lg-footer-col { font-size: 12.5px; line-height: 1.65; }
.lg-footer-h {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand-dark);
  font-weight: 700;
  margin-bottom: 10px;
}
html[data-theme="dark"] .lg-footer-h { color: var(--brand); }
.lg-footer-p { color: var(--muted); margin-bottom: 12px; }
.lg-footer-badge {
  display: inline-block;
  padding: 4px 11px;
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  background: rgba(10,138,138,0.06);
  color: var(--brand-dark);
  font-weight: 600;
}
html[data-theme="dark"] .lg-footer-badge { color: var(--brand); background: rgba(10,138,138,0.18); }
.lg-footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.lg-footer-list li {
  padding: 3px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.lg-footer-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2bc77c;
  box-shadow: 0 0 0 3px rgba(43,199,124,0.18);
}
.lg-footer-bar {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.03em;
  color: var(--muted);
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}
.lg-footer-tech { opacity: 0.8; }

@media (max-width: 900px) {
  .lg-footer { padding: 28px 18px 16px; margin-top: 36px; }
  .lg-footer-inner { grid-template-columns: 1fr 1fr; gap: 20px; }
  .lg-footer-bar { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 520px) {
  .lg-footer-inner { grid-template-columns: 1fr; gap: 18px; }
}

/* Theme toggle on login */
.lg-theme {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: transform .2s var(--ease);
  z-index: 10;
}
.lg-theme:hover { transform: rotate(18deg); }

/* ═══════════════════════════════════════════════════════════
   APP SHELL · Header + Views
═══════════════════════════════════════════════════════════ */
#app, #requests-view, #users-view { display: none; }
#app.on, #requests-view.on, #users-view.on { display: block; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  -webkit-backdrop-filter: blur(14px);
          backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.app-header-inner {
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-variation-settings: "opsz" 20, "SOFT" 40;
  font-weight: 500;
  font-size: 17px;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.01em;
  flex-shrink: 0;
}
.app-header-brand .brand-mark-ico { width: 28px; height: 28px; font-size: 13px; border-radius: 7px; }

.app-header-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 10px;
  margin-left: 10px;
  border-left: 1px solid var(--border);
  line-height: 1.2;
  max-width: 170px;
  display: block;
}
@media (max-width: 700px) {
  .app-header-sub { display: none; }
}

.app-header-spacer { flex: 1; }

.app-nav {
  display: flex;
  gap: 4px;
  align-items: center;
}
.app-nav-item {
  position: relative;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--muted);
  border-radius: 8px;
  transition: background .18s var(--ease), color .18s var(--ease);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.app-nav-item:hover { color: var(--ink); background: var(--paper-2); }
.app-nav-item.active { color: var(--ink); background: var(--paper-2); font-weight: 600; }
.app-nav-item .nav-badge {
  display: none;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
}
.app-nav-item .nav-badge.on { display: inline-flex; }

.app-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.app-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px 6px 6px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}
.app-user-avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
}
.app-user-role {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  padding-left: 6px;
  border-left: 1px solid var(--border);
  font-weight: 600;
}

.app-iconbtn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--paper);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 15px;
  color: var(--ink-2);
  transition: background .18s var(--ease), border-color .18s var(--ease), transform .15s var(--ease);
}
.app-iconbtn:hover { background: var(--paper-2); border-color: var(--border-strong); }
.app-iconbtn:active { transform: translateY(1px); }
.app-iconbtn.iconbtn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.app-iconbtn.iconbtn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* Presence strip */
.presence-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 4px 20px 10px;
  max-width: 1560px;
  margin: 0 auto;
}
.presence-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 6px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.presence-chip .p-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--sage);
}

/* Content area */
.app-content {
  max-width: 1560px;
  margin: 0 auto;
  padding: 20px;
}

/* Section heading */
.section-hd {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.section-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 48, "SOFT" 30;
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.025em;
}
.section-title em {
  font-style: italic;
  font-variation-settings: "opsz" 48, "SOFT" 80, "WONK" 1;
  color: var(--brand-dark);
}
html[data-theme="dark"] .section-title em { color: var(--brand); }
.section-sub {
  font-size: 13px;
  color: var(--muted);
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  margin-top: 4px;
}

/* Toolbar */
.toolbar {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--sh-sm);
  margin-bottom: 16px;
}
.toolbar-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}
.toolbar-search {
  flex: 1 1 260px;
  min-width: 200px;
  position: relative;
}
.toolbar-search::before {
  content: '';
  position: absolute;
  left: 12px; top: 50%;
  width: 14px; height: 14px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14' fill='none' stroke='%236b6c66' stroke-width='1.5'%3E%3Ccircle cx='6' cy='6' r='4.5'/%3E%3Cline x1='9.5' y1='9.5' x2='12.5' y2='12.5'/%3E%3C/svg%3E") no-repeat center / contain;
  pointer-events: none;
}
.toolbar-search input {
  width: 100%;
  padding: 9px 12px 9px 34px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.toolbar-search input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--sh-focus);
}

.toolbar-select {
  padding: 9px 30px 9px 12px;
  background: var(--paper-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none' stroke='%236b6c66' stroke-width='1.5'%3E%3Cpath d='M1.5 3.5L5 7l3.5-3.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  min-width: 140px;
}
html[data-theme="dark"] .toolbar-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='none' stroke='%23989588' stroke-width='1.5'%3E%3Cpath d='M1.5 3.5L5 7l3.5-3.5'/%3E%3C/svg%3E");
}
.toolbar-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--sh-focus);
}

/* Month chips */
.month-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.month-strip::-webkit-scrollbar { height: 4px; }
.month-card {
  flex-shrink: 0;
  padding: 7px 13px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.month-card:hover {
  background: var(--paper-2);
  border-color: var(--border-strong);
}
.month-card.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.month-card-count {
  font-size: 10px;
  opacity: 0.75;
  padding: 1px 5px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 6px;
}

/* Stats bar */
.stats-bar {
  display: flex;
  gap: 18px;
  padding: 14px 16px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin-top: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  box-shadow: var(--sh-sm);
}
.stats-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 84px;
}
.stats-num {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36, "SOFT" 40;
  font-weight: 500;
  font-size: 28px;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.stats-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-transform: uppercase;
  font-weight: 600;
}
.stats-num.c-aktiv      { color: var(--brand-dark); }
.stats-num.c-angefragt  { color: var(--slate); }
.stats-num.c-abbestellt { color: var(--amber); }
.stats-num.c-abgeholt   { color: var(--sage); }
html[data-theme="dark"] .stats-num.c-aktiv { color: var(--brand); }

/* ═══════════════════════════════════════════════════════════
   CONTAINER LIST — Premium Editorial Cards
═══════════════════════════════════════════════════════════ */
.container-list {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) and (max-width: 1599px) {
  .container-list { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1600px) {
  .container-list { grid-template-columns: 1fr 1fr; }
}

.c-card {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .22s var(--ease), transform .22s var(--ease), box-shadow .22s var(--ease);
  box-shadow: var(--sh-sm);
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0;
  position: relative;
}
@media (max-width: 560px) {
  .c-card { grid-template-columns: 130px 1fr; }
}
@media (max-width: 400px) {
  .c-card { grid-template-columns: 1fr; }
  .c-card .c-fotos { border-right: none; border-bottom: 1px solid var(--border); height: 180px; }
}

.c-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--sh-md);
}
.c-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--muted-2);
  transition: background .2s var(--ease);
}
.c-card.c-st-aktiv::before      { background: var(--brand); }
.c-card.c-st-angefragt::before  { background: var(--slate); }
.c-card.c-st-abbestellt::before { background: var(--amber); }
.c-card.c-st-abgeholt::before   { background: var(--sage); }

.c-fotos {
  position: relative;
  background: var(--paper-2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px;
  border-right: 1px solid var(--border);
  min-height: 160px;
}
.c-fotos img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
  transition: transform .25s var(--ease);
}
.c-fotos img:hover { transform: scale(1.02); }

.c-fotos-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--muted-2);
  font-size: 32px;
  background: repeating-linear-gradient(
    135deg,
    transparent 0 8px,
    color-mix(in srgb, var(--border) 40%, transparent) 8px 9px
  );
  border-radius: 6px;
}

.c-body {
  padding: 14px 16px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.c-body-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.c-nr {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 20, "SOFT" 30, "WONK" 0;
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.c-nr-prefix {
  color: var(--muted-2);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  margin-right: 3px;
}
.c-cname {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 3px;
}

/* Status pill */
.c-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  flex-shrink: 0;
  white-space: nowrap;
}
.c-status::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.c-status.aktiv      { background: var(--brand-soft); color: var(--brand-dark); }
.c-status.angefragt  { background: var(--slate-soft); color: var(--slate); }
.c-status.abbestellt { background: var(--amber-soft); color: var(--amber); }
.c-status.abgeholt   { background: var(--sage-soft); color: var(--sage); }
html[data-theme="dark"] .c-status.aktiv { color: var(--brand); }

.c-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
  font-size: 13px;
}
.c-grid .c-row {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.c-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.c-val {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.c-val.dim { color: var(--muted-2); }
.c-val .c-avv {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--amber);
  letter-spacing: 0.02em;
  margin-top: 1px;
  display: inline-block;
}

/* ═══════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .12s var(--ease), background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
  font-family: inherit;
  letter-spacing: 0.01em;
}
.btn:active { transform: translateY(1px); }
.btn.btn-sm { padding: 7px 11px; font-size: 12px; }
.btn.btn-lg { padding: 13px 18px; font-size: 15px; min-height: 48px; }

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
html[data-theme="dark"] .btn-primary { background: var(--brand); color: #0b1516; border-color: var(--brand); }
html[data-theme="dark"] .btn-primary:hover { background: #46c2c2; border-color: #46c2c2; }

.btn-ghost {
  background: var(--paper);
  color: var(--ink-2);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--paper-2); border-color: var(--border-strong); color: var(--ink); }

.btn-danger {
  background: var(--rose-soft);
  color: var(--rose);
  border-color: color-mix(in srgb, var(--rose) 30%, transparent);
}
.btn-danger:hover { background: var(--rose); color: #fff; border-color: var(--rose); }

.btn-teal {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border-color: color-mix(in srgb, var(--brand) 30%, transparent);
}
html[data-theme="dark"] .btn-teal { color: var(--brand); }
.btn-teal:hover { background: var(--brand); color: #fff; border-color: var(--brand); }

.btn-amber {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: color-mix(in srgb, var(--amber) 30%, transparent);
}
.btn-amber:hover { background: var(--amber); color: #fff; border-color: var(--amber); }

.btn-sage {
  background: var(--sage-soft);
  color: var(--sage);
  border-color: color-mix(in srgb, var(--sage) 30%, transparent);
}
.btn-sage:hover { background: var(--sage); color: #fff; border-color: var(--sage); }

/* Legacy role classes — hidden by applyRole() */
.admin-only, .superadmin-only, .worker-only, .can-edit, .admin-or-readonly { }

/* ═══════════════════════════════════════════════════════════
   MODALS
═══════════════════════════════════════════════════════════ */
.modal-bg {
  display: none;
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, var(--ink) 50%, transparent);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: bgFadeIn 0.22s var(--ease);
}
.modal-bg.open { display: flex; }
@keyframes bgFadeIn { from { opacity: 0; } to { opacity: 1; } }
body.modal-open { overflow: hidden; }

.modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  padding: clamp(18px, 2.4vw, 28px);
  width: 100%;
  max-width: 620px;
  max-height: calc(100vh - 40px);
  max-height: calc(100svh - 40px);
  overflow-y: auto;
  box-shadow: var(--sh-lg);
  border: 1px solid var(--border);
  position: relative;
  animation: modalRise 0.32s var(--ease);
}
@keyframes modalRise {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}

.modal h3 {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 28, "SOFT" 40;
  font-weight: 500;
  font-size: 24px;
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  transition: background .18s var(--ease), color .18s var(--ease);
}
.modal-close:hover { background: var(--paper-2); color: var(--ink); }

.modal-btns {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.modal-btns .btn-primary { min-height: 48px; padding: 12px 22px; font-size: 15px; }

/* Fields */
.field {
  margin-bottom: 12px;
}
.field label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 5px;
  font-family: var(--font-body);
}
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 10px 12px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--paper);
  box-shadow: var(--sh-focus);
}
.field textarea { min-height: 72px; resize: vertical; }
.field input[type=file] {
  padding: 8px;
  background: var(--paper);
  cursor: pointer;
  font-size: 12px;
}
.field input[readonly] { background: var(--brand-softer); color: var(--brand-dark); font-weight: 600; }

/* Chip-list for saved entries (standort, entsorger, etc.) */
.chip-list {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.chip-list-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  font-family: var(--font-mono);
}
.chip-list-item:hover { background: var(--brand-softer); border-color: var(--brand); color: var(--brand-dark); }
.chip-list-item .chip-del {
  font-size: 9px;
  color: var(--muted-2);
  padding: 1px 3px;
  border-radius: 999px;
}
.chip-list-item .chip-del:hover { background: var(--rose-soft); color: var(--rose); }

/* Foto preview row inside edit modal */
.foto-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.foto-preview > div {
  position: relative;
  display: inline-block;
}
.foto-preview img {
  width: 112px;
  height: 84px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

/* Detail modal: tabs */
.d-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-top: 10px;
  margin-bottom: 16px;
}
.d-tab {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-radius: 7px;
  cursor: pointer;
  text-transform: uppercase;
  transition: background .18s var(--ease), color .18s var(--ease);
  border: none;
  background: none;
}
.d-tab:hover { color: var(--ink-2); }
.d-tab.active { background: var(--paper); color: var(--ink); box-shadow: var(--sh-sm); }
.d-tab-panel { display: none; }
.d-tab-panel.active { display: block; }

/* Detail modal info grid */
.d-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 20px;
  padding: 2px 0;
}
@media (max-width: 600px) {
  .d-info-grid { grid-template-columns: 1fr; }
}
.d-info-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.d-info-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.d-info-val {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.4;
  word-break: break-word;
}
.d-info-val.mono { font-family: var(--font-mono); font-size: 13px; }

.d-fotos-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.d-fotos-block img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
  transition: transform .2s var(--ease);
}
.d-fotos-block img:hover { transform: scale(1.03); }

.d-action-zone {
  margin-top: 18px;
  padding: 12px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.d-action-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 8px;
}
.d-action-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ═══════════════════════════════════════════════════════════
   LEGACY ALIAS CLASSES — keep JS untouched
═══════════════════════════════════════════════════════════ */
.login-box { /* old; we render new — just in case something still references */ }
.login-err { display: none; }
.header, .logo, .actions, .search, .stats { }
.desktop-only { }
@media (max-width: 900px) { .desktop-only { display: none !important; } }


/* ═══ CARD LAYOUT FIX · JS-Klassen-Aliase + DOM-Order unabhängig ═══ */

/* Full-Width auf Desktop — App nutzt komplette Breite */
.app-header-inner,
.presence-strip,
.app-content,
.app-footer {
  max-width: none !important;
  width: 100%;
}
.app-header-inner { padding-left: 28px; padding-right: 28px; }
.app-content      { padding-left: 28px; padding-right: 28px; }
.app-footer       { padding-left: 28px; padding-right: 28px; }

/* Container-Grid: mehr Spalten auf breiten Desktops */
.container-list {
  grid-template-columns: 1fr;
}
@media (min-width: 900px)  { .container-list { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1600px) { .container-list { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 2200px) { .container-list { grid-template-columns: repeat(4, 1fr); } }

.c-card {
  grid-template-columns: 1fr 200px;   /* content · foto (entspricht DOM-Order aus JS) */
  grid-template-areas: "body foto";
}
/* Tablet & kleine Desktops */
@media (max-width: 1200px) {
  .app-header-inner { padding-left: 20px; padding-right: 20px; }
  .app-content      { padding-left: 20px; padding-right: 20px; }
  .app-footer       { padding-left: 20px; padding-right: 20px; }
  .c-card { grid-template-columns: 1fr 180px; }
}
/* Großer Mobile / kleines Tablet */
@media (max-width: 720px) {
  .c-card { grid-template-columns: 1fr 150px; }
}
/* Mobile */
@media (max-width: 560px) {
  .c-card { grid-template-columns: 1fr 120px; }
}
/* Sehr schmale Handys: Foto oben, Text unten */
@media (max-width: 440px) {
  .c-card {
    grid-template-columns: 1fr;
    grid-template-areas: "foto" "body";
  }
  .c-card .c-fotos { border-right: none; border-left: none; border-bottom: 1px solid var(--border); height: 160px; flex-direction: row; }
  .c-card .c-fotos img { width: 50%; }
  .c-card .c-fotos-empty { flex: 1; }
}

/* DOM-unabhängige Zuordnung */
.c-data  { grid-area: body; padding: 14px 18px 14px 18px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.c-fotos { grid-area: foto; border-right: none; border-left: 1px solid var(--border); }

/* Status-Klassen ohne c-st-Prefix (JS schreibt c-card aktiv/angefragt/…) */
.c-card.aktiv::before      { background: var(--brand); }
.c-card.angefragt::before  { background: var(--slate); }
.c-card.abbestellt::before { background: var(--amber); }
.c-card.abgeholt::before   { background: var(--sage); }

/* .c-top – Header-Reihe in der Card */
.c-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex-wrap: wrap;
}
.c-top .c-nr {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 22, "SOFT" 30, "WONK" 0;
  font-weight: 500;
  font-size: 19px;
  line-height: 1.15;
  color: var(--ink);
  letter-spacing: -0.01em;
  word-break: break-word;
}

/* .c-item – Felder in .c-grid (statt .c-row) */
.c-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 18px;
}
.c-grid .c-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.c-grid .c-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}
.c-grid .c-val {
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

/* Notiz (nur superadmin) */
.c-notiz {
  margin-top: 4px;
  padding: 7px 10px;
  background: var(--paper-2);
  border-left: 2px solid var(--amber);
  border-radius: 4px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* Mobile: Text-Notiz am Ende */
@media (max-width: 400px) {
  .c-data { padding: 12px 14px; }
  .c-top .c-nr { font-size: 17px; }
  .c-grid { grid-template-columns: 1fr; gap: 4px 0; }
}
/* ═══ END CARD FIX ═══ */



/* ═══ FRAUNCES J-CALM — descender weniger extrovertiert ═══ */
.lg-title,
.doc-title,
.section-title,
.view-head-title,
.brand-mark-text,
.brand-text,
.c-nr,
.dispo-card h4,
.avv-group,
.feature-card h4,
.doc-h2,
.doc-h3 {
  font-feature-settings: "ss01" 0, "ss02" 0, "cv11" 0, "salt" 0;
}
.lg-title {
  font-variation-settings: "opsz" 96, "SOFT" 25, "WONK" 0;
}
.lg-title em {
  font-style: italic;
  font-variation-settings: "opsz" 96, "SOFT" 50, "WONK" 0;
}
.doc-title { font-variation-settings: "opsz" 110, "SOFT" 20, "WONK" 0; }
.doc-title em { font-variation-settings: "opsz" 110, "SOFT" 45, "WONK" 0; }
.section-title { font-variation-settings: "opsz" 40, "SOFT" 20, "WONK" 0; }
.section-title em { font-variation-settings: "opsz" 40, "SOFT" 50, "WONK" 0; }
.view-head-title { font-variation-settings: "opsz" 32, "SOFT" 20, "WONK" 0; }
.view-head-title em { font-variation-settings: "opsz" 32, "SOFT" 50, "WONK" 0; }
/* ═══ END J-CALM ═══ */


/* ═══ MOBILE HEADER FIX + THEME-TOGGLE ENTFERNT ═══ */
/* Theme-Toggle komplett raus — nur Dark bleibt */
#theme-toggle,
#lg-theme-toggle,
.lg-theme { display: none !important; }

/* Header-Layout: Brand + Meta = Zeile 1, Nav = Zeile 2 auf Mobile */
@media (max-width: 820px) {
  .app-header-inner {
    flex-wrap: wrap;
    row-gap: 10px;
    padding: 12px 16px;
    gap: 10px;
  }
  .app-header-brand { flex: 1; min-width: 0; }
  .app-header-spacer { display: none; }
  .app-meta { flex-shrink: 0; }
  .app-nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
    gap: 4px;
    justify-content: flex-start;
    scrollbar-width: none;
  }
  .app-nav::-webkit-scrollbar { display: none; }
  .app-nav-item {
    flex-shrink: 0;
    white-space: nowrap;
  }
  .app-user-chip { padding: 4px 9px 4px 4px; font-size: 11px; max-width: 120px; }
  .app-user-chip #app-user-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 520px) {
  .app-header-inner { padding: 10px 12px; gap: 8px; row-gap: 8px; }
  .app-header-brand { font-size: 15px !important; gap: 8px !important; }
  .app-header-brand .brand-mark-ico { width: 30px !important; height: 30px !important; font-size: 12px !important; border-radius: 7px !important; }
  .app-header-sub { font-size: 8px !important; letter-spacing: 0.1em !important; }
  .app-user-chip { max-width: 100px; }
  .app-user-chip #app-user-name { max-width: 60px; }
  .app-iconbtn { width: 32px; height: 32px; font-size: 14px; }
  .app-nav-item { padding: 6px 12px; font-size: 12px; }
}
/* ═══ END MOBILE HEADER FIX ═══ */

/* ═══ HEADER BRAND REFINEMENT ═══ */

/* CM-Icon exakt mittig — monospaced font hat oft asymmetrische vertikale metrics */
.brand-mark-ico {
  line-height: 1;
  text-indent: 0;
  font-feature-settings: "tnum" 1;
  padding-top: 1px;   /* optical center fix */
}

/* Login Hero (.brand-mark) — großzügiger */
.brand-mark {
  gap: 14px;
}
.brand-mark .brand-mark-ico {
  width: 42px; height: 42px;
  font-size: 16px;
  border-radius: 10px;
}
.brand-mark-text {
  font-size: 22px;
  line-height: 1.05;
}
.brand-mark-text em {
  margin-top: 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  white-space: nowrap;
}

/* App-Header Brand (nach Login) — deutlich größer + Sub einzeilig */
.app-header-inner { padding-top: 14px; padding-bottom: 14px; gap: 16px; }

.app-header-brand {
  gap: 12px;
  font-size: 22px;
  line-height: 1.05;
  align-items: center;
}
.app-header-brand > div:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.app-header-brand .brand-mark-ico {
  width: 40px;
  height: 40px;
  font-size: 15px;
  border-radius: 10px;
}

/* Sub-Zeile einzeilig, eigene Zeile unter Container Manager, kein Border-Divider */
.app-header-sub {
  display: block !important;
  padding-left: 0 !important;
  margin-left: 0 !important;
  border-left: none !important;
  white-space: nowrap;
  max-width: none !important;
  font-size: 10px;
  letter-spacing: 0.18em;
  line-height: 1.1;
  color: var(--muted);
}

/* Nav/Meta nicht drücken */
.app-header-spacer { min-width: 16px; }

/* Tablet: Brand etwas kleiner aber weiterhin deutlich */
@media (max-width: 1100px) {
  .app-header-brand { font-size: 19px; }
  .app-header-brand .brand-mark-ico { width: 36px; height: 36px; font-size: 14px; }
  .app-header-sub { font-size: 9.5px; letter-spacing: 0.14em; }
}

/* Mobile: kompakter, aber lesbar; sub bleibt dran statt wegzufallen */
@media (max-width: 700px) {
  .app-header-brand { font-size: 17px; gap: 10px; }
  .app-header-brand .brand-mark-ico { width: 32px; height: 32px; font-size: 12px; border-radius: 8px; }
  .app-header-sub {
    display: block !important;
    font-size: 9px !important;
    letter-spacing: 0.1em !important;
    white-space: nowrap;
  }
}
@media (max-width: 440px) {
  .app-header-brand { font-size: 15px; }
  .app-header-sub { font-size: 8.5px !important; }
}
/* ═══ END HEADER BRAND ═══ */

/* ═══════════════════════════════════════════════════════════
   IMG VIEWER (fullscreen)
═══════════════════════════════════════════════════════════ */
.img-viewer {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(8, 10, 12, 0.96);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.img-viewer.on, .img-viewer[style*="display: flex"], .img-viewer[style*="display:flex"] { display: flex; }
.img-viewer img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.img-viewer-close {
  position: absolute;
  top: 16px; right: 18px;
  font-size: 40px;
  color: rgba(255,255,255,0.9);
  background: rgba(20, 24, 26, 0.6);
  border: 1px solid rgba(255,255,255,0.18);
  width: 44px; height: 44px;
  border-radius: 999px;
  display: grid; place-items: center;
  line-height: 1;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 300;
}
.img-viewer-close:hover { background: rgba(40, 44, 46, 0.8); }
.img-viewer-nav {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
}
.img-viewer-nav button {
  padding: 9px 14px;
  background: rgba(20, 24, 26, 0.7);
  border: 1px solid rgba(255,255,255,0.16);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 500;
  letter-spacing: 0.04em;
}
.img-viewer-nav button:hover { background: rgba(40, 44, 46, 0.82); }
.img-viewer-counter {
  position: absolute;
  top: 20px;
  left: 20px;
  padding: 6px 11px;
  background: rgba(20, 24, 26, 0.7);
  color: rgba(255,255,255,0.8);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ═══════════════════════════════════════════════════════════
   REQUESTS + USERS VIEWS
═══════════════════════════════════════════════════════════ */
.view-head {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: var(--sh-sm);
}
.view-head-title {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 36, "SOFT" 40;
  font-weight: 500;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--ink);
  flex: 1;
  min-width: 180px;
}
.view-head-title em {
  font-style: italic;
  font-variation-settings: "opsz" 36, "SOFT" 80, "WONK" 1;
  color: var(--brand-dark);
}
html[data-theme="dark"] .view-head-title em { color: var(--brand); }

/* Request list wrapper */
.req-wrap {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--sh-sm);
}

/* User management list */
.users-list { display: flex; flex-direction: column; gap: 8px; }

/* ═══════════════════════════════════════════════════════════
   FOOTER (optional, on login + app shell bottom)
═══════════════════════════════════════════════════════════ */
.app-footer {
  max-width: 1560px;
  margin: 40px auto 0;
  padding: 24px 20px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  flex-wrap: wrap;
  gap: 8px;
}
.app-footer a { color: var(--brand-dark); font-weight: 600; }
html[data-theme="dark"] .app-footer a { color: var(--brand); }

/* Mobile tweaks */
@media (max-width: 640px) {
  .app-header-inner { padding: 10px 14px; gap: 8px; }
  .app-nav-item { padding: 6px 10px; font-size: 12px; }
  .app-user-chip { padding: 4px 8px 4px 4px; font-size: 11px; }
  .app-user-role { display: none; }
  .app-content { padding: 14px; }
  .section-title { font-size: 28px; }
  .view-head { padding: 14px 16px; }
  .view-head-title { font-size: 22px; }
  .modal { padding: 18px; max-height: 100vh; max-height: 100svh; border-radius: 16px 16px 0 0; }
  .modal-btns { justify-content: stretch; }
  .modal-btns .btn { flex: 1; }
  .btn { min-height: 40px; }
}

/* Safe-area */
@supports (padding: env(safe-area-inset-bottom)) {
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* Print (for CSV exports etc.) */
@media print {
  .app-header, .app-footer, .toolbar, .month-strip, .stats-bar { display: none; }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   MINI UTILS
═══════════════════════════════════════════════════════════ */
.hidden, [hidden] { display: none !important; }
.spacer { flex: 1; }
.nowrap { white-space: nowrap; }
.mono { font-family: var(--font-mono); }

/* ═══ USERNAME vollständig anzeigen ═══ */
.app-user-chip {
  max-width: none !important;
  overflow: visible !important;
}
.app-user-chip #app-user-name {
  overflow: visible !important;
  text-overflow: clip !important;
  white-space: nowrap !important;
  max-width: none !important;
}
/* Auf Mobile: Rolle weg, Name ganz sichtbar */
@media (max-width: 820px) {
  .app-user-role { display: none !important; }
}
@media (max-width: 520px) {
  .app-user-chip { padding: 4px 10px 4px 4px; font-size: 12px; gap: 6px; }
  .app-user-chip #app-user-name { max-width: none !important; font-weight: 600; }
  .app-user-avatar { width: 20px; height: 20px; font-size: 10px; }
}
@media (max-width: 380px) {
  .app-user-avatar { display: none; }
  .app-user-chip { padding: 5px 10px; border-radius: 8px; }
}
/* ═══ END USERNAME FIX ═══ */


/* ═══ J SCHNÖRKEL ENDGÜLTIG WEG — keine italic auf Display-Headings ═══ */
.lg-title em,
.doc-title em,
.section-title em,
.view-head-title em,
.doc-h2 em,
.dispo-card h4 em,
.avv-group em {
  font-style: normal !important;
  font-variation-settings: "opsz" 96, "SOFT" 25, "WONK" 0 !important;
  color: var(--brand);
  font-feature-settings: "ss01" 0, "ss02" 0, "cv11" 0, "salt" 0 !important;
}
html[data-theme="dark"] .lg-title em,
html[data-theme="dark"] .doc-title em,
html[data-theme="dark"] .section-title em,
html[data-theme="dark"] .view-head-title em { color: var(--brand); }
/* ═══ END ═══ */


/* ═══ SCHNÖRKEL-KILL — alle Fraunces-Display-Elemente ROMAN, kein italic ═══ */
.lg-title, .lg-title *,
.doc-title, .doc-title *,
.section-title, .section-title *,
.view-head-title, .view-head-title *,
.doc-h2, .doc-h2 *,
.doc-h3, .doc-h3 *,
.brand-text, .brand-text *,
.brand-mark-text, .brand-mark-text *,
.app-header-brand, .app-header-brand *,
.c-nr, .c-nr *,
.feature-card h4, .feature-card h4 *,
.dispo-card h4, .dispo-card h4 *,
.avv-group, .avv-group *,
.modal h3, .modal h3 * {
  font-style: normal !important;
  font-variation-settings: "opsz" 48, "SOFT" 0, "WONK" 0 !important;
  font-feature-settings: "ss01" 0, "ss02" 0, "ss03" 0, "ss04" 0, "cv01" 0, "cv11" 0, "salt" 0, "dlig" 0 !important;
}
/* Brand-Farbe in em-Elementen beibehalten */
.lg-title em, .doc-title em, .section-title em, .view-head-title em,
.doc-h2 em, .dispo-card h4 em, .avv-group em {
  color: var(--brand) !important;
}
/* ═══ END SCHNÖRKEL-KILL ═══ */


/* ═══ DATE-INPUT FIX (bestell-modal etc.) ═══ */
/* Native Date-Picker dunkel stylen */
html { color-scheme: dark; }
input[type="date"] {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  background: var(--paper-2) !important;
  color: var(--ink) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  min-height: 40px;
  -webkit-appearance: none;
  appearance: none;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.7);
  cursor: pointer;
}
input[type="date"]::-webkit-datetime-edit {
  color: var(--ink);
}
input[type="date"]::-webkit-datetime-edit-fields-wrapper { color: var(--ink); }
input[type="date"]:focus {
  outline: none;
  border-color: var(--brand) !important;
  background: var(--paper) !important;
  box-shadow: var(--sh-focus);
}
/* Leerer Wert nicht transparent */
input[type="date"]:not([value=""]):in-range { color: var(--ink); }
input[type="date"]:invalid { color: var(--muted); }
/* ═══ END ═══ */


/* ═══ FOTO UPLOAD STACK · zentriert untereinander ═══ */
.foto-upload-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-items: stretch;
  padding: 4px 0 8px;
}
.foto-upload-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 20px 24px;
  background: var(--paper);
  border: 1px dashed var(--border-strong);
  border-radius: 12px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.foto-upload-item:hover {
  border-color: var(--brand);
  background: var(--paper-2);
}
.foto-upload-item > label {
  text-align: center !important;
  margin-bottom: 2px !important;
}
.foto-upload-item input[type="file"] {
  width: auto !important;
  min-width: 220px;
  max-width: 100%;
  padding: 10px 14px !important;
  background: var(--paper-2) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-2);
  font-family: var(--font-body);
  text-align: center;
}
.foto-upload-item input[type="file"]::-webkit-file-upload-button,
.foto-upload-item input[type="file"]::file-selector-button {
  background: var(--brand-dark);
  color: #fff;
  border: none;
  padding: 7px 14px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-right: 12px;
  cursor: pointer;
  transition: background .15s var(--ease);
}
.foto-upload-item input[type="file"]::-webkit-file-upload-button:hover,
.foto-upload-item input[type="file"]::file-selector-button:hover {
  background: var(--brand);
}
.foto-upload-item > div {
  text-align: center;
}
/* ═══ END ═══ */


/* ═══ DATE-INPUT · kalender-icon prominenter ═══ */
input[type="date"] {
  cursor: pointer;
  position: relative;
}
input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) opacity(0.85);
  cursor: pointer;
  width: 22px;
  height: 22px;
  padding: 3px;
  background: rgba(42, 179, 179, 0.12);
  border-radius: 6px;
  margin-right: 2px;
  transition: background .15s var(--ease), opacity .15s var(--ease);
}
input[type="date"]:hover::-webkit-calendar-picker-indicator {
  background: rgba(42, 179, 179, 0.25);
  filter: invert(1) opacity(1);
}
/* ═══ END ═══ */


/* ═══ CONTAINER NR · klassische Serif (nicht extravagant) ═══ */
.c-top .c-nr,
#d-title,
.c-nr {
  font-family: "Cormorant Garamond", "EB Garamond", "Times New Roman", Georgia, serif !important;
  font-variation-settings: normal !important;
  font-feature-settings: "tnum" 1, "lnum" 1;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  font-style: normal !important;
}
.c-top .c-nr { font-size: 22px; }
#d-title { font-size: 26px; line-height: 1.15; }
/* ═══ END ═══ */


/* ═══ LG-HELP-ROW · Email + Hilfe in einer Zeile ═══ */
.lg-help-row {
  flex-wrap: nowrap !important;
  gap: 8px;
  font-size: 11px !important;
  padding-top: 14px !important;
  overflow: hidden;
}
.lg-help-row .lg-help-link {
  white-space: nowrap;
  color: var(--brand) !important;
  font-weight: 600;
  border-bottom: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
  font-size: 11px;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lg-help-row .lg-help-link {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
/* Login-Card leicht breiter damit die Zeile komfortabel passt */
.lg-card { max-width: 460px !important; }
@media (max-width: 440px) {
  .lg-help-row .lg-help-link { font-size: 10.5px; }
}
/* ═══ END ═══ */


/* ═══ DISPLAY FONT SWAP · Fraunces → Cormorant Garamond für Hero-Titles ═══ */
.lg-title,
.lg-title *,
.doc-title,
.doc-title *,
.section-title,
.section-title *,
.view-head-title,
.view-head-title * {
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, "Times New Roman", serif !important;
  font-variation-settings: normal !important;
  font-feature-settings: "lnum" 1, "tnum" 0 !important;
  font-weight: 600 !important;
  letter-spacing: -0.01em !important;
  font-style: normal !important;
}
.lg-title em,
.doc-title em,
.section-title em,
.view-head-title em {
  color: var(--brand) !important;
  font-weight: 600 !important;
}
/* Cormorant braucht etwas mehr Gewicht um bei großen Größen präsent zu sein */
.lg-title { font-weight: 500 !important; }
.lg-title em { font-weight: 600 !important; }
/* ═══ END ═══ */


/* ═══ SCROLL-LOCK wenn irgendein Modal offen ═══ */
html:has(.modal-bg.open),
body:has(.modal-bg.open) {
  overflow: hidden !important;
  overscroll-behavior: contain;
}
/* Fallback für Browser ohne :has() */
body.modal-open {
  overflow: hidden !important;
  position: relative;
}
/* iOS Safari: fixed body verhindert Background-Scroll auch bei Touch */
@supports (-webkit-touch-callout: none) {
  body:has(.modal-bg.open) {
    position: fixed;
    width: 100%;
    height: 100%;
  }
}
/* ═══ END ═══ */


/* ═══ HERO-TITLE · sans-serif wie der Body-Text ═══ */
.lg-title,
.lg-title *,
.lg-title em {
  font-family: "Public Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  font-variation-settings: normal !important;
  font-feature-settings: normal !important;
  font-weight: 700 !important;
  font-style: normal !important;
  letter-spacing: -0.02em !important;
}
.lg-title em {
  color: var(--brand) !important;
  font-weight: 700 !important;
}
/* ═══ END ═══ */


/* ═══ CONTAINER-NR · Sans-Serif (konsistent mit Landing) ═══ */
.c-top .c-nr,
.c-nr,
#d-title {
  font-family: "Public Sans", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif !important;
  font-feature-settings: "tnum" 1, "lnum" 1 !important;
  font-variation-settings: normal !important;
  font-weight: 700 !important;
  letter-spacing: -0.015em !important;
  font-style: normal !important;
}
.c-top .c-nr { font-size: 20px; }
#d-title { font-size: 22px; line-height: 1.2; }
/* ═══ END ═══ */


/* ═══ NOTIZ-LÖSCH-BUTTON (superadmin) ═══ */
.notiz-del {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px; height: 22px;
  background: var(--rose-soft);
  color: var(--rose);
  border: 1px solid color-mix(in srgb, var(--rose) 30%, transparent);
  border-radius: 999px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  margin-left: 8px;
  transition: background .15s var(--ease), color .15s var(--ease);
  font-weight: 600;
  padding: 0;
  flex-shrink: 0;
}
.notiz-del:hover { background: var(--rose); color: #fff; }
/* ═══ END ═══ */


/* ═══ VERLAUF (Log) · dunkel ═══ */
.log-box {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--paper-2);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.log-items {
  font-size: 13px;
  color: var(--ink-2);
  max-height: 220px;
  overflow-y: auto;
}
.log-item {
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.log-item:last-child { border-bottom: none; }

/* Fallback: wenn das alte Template noch drin ist */
#d-body div[style*="#f8fafb"] {
  background: var(--paper-2) !important;
  border-color: var(--border) !important;
}
#d-body div[style*="#4b5563"] { color: var(--ink-2) !important; }
#d-body div[style*="#f0f0f0"] { border-color: var(--border) !important; }
#d-body div[style*="#e5e7eb"] { border-color: var(--border) !important; }

/* ═══ NOTIZ-DEL · prominenter Button + NOTIZ-Card sichtbar ═══ */
.c-notiz {
  display: flex !important;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
  margin-top: 8px;
  padding: 10px 14px;
  background: var(--amber-soft) !important;
  border-left: 3px solid var(--amber);
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.5;
}
.notiz-del {
  width: 26px !important;
  height: 26px !important;
  font-size: 18px !important;
  background: var(--rose) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(201, 80, 92, 0.4);
  cursor: pointer;
  transition: transform .15s var(--ease), background .15s var(--ease);
  flex-shrink: 0;
  line-height: 1 !important;
  padding: 0 !important;
  border-radius: 999px !important;
}
.notiz-del:hover {
  background: #e0626e !important;
  transform: scale(1.1);
}
/* ═══ END ═══ */


/* ═══ LOG-ITEM · einzelner Löschen-Button (weißes ×) ═══ */
.log-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.log-text { flex: 1; min-width: 0; }
.log-del {
  width: 20px;
  height: 20px;
  font-size: 14px;
  background: transparent !important;
  color: var(--muted-2) !important;
  border: none !important;
  border-radius: 999px;
  cursor: pointer;
  padding: 0 !important;
  line-height: 1 !important;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s var(--ease), color .15s var(--ease);
  font-weight: 400;
  font-family: inherit;
}
.log-del:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--ink) !important;
}
/* ═══ END ═══ */


/* ═══ LANDING · VALUE PROP + SOCIAL PROOF ═══ */
.lg-value {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px 28px;
  margin: 32px 0 18px;
  padding-top: 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 2;
}
@media (max-width: 900px) {
  .lg-value { grid-template-columns: 1fr 1fr; gap: 16px 18px; }
}
@media (max-width: 520px) {
  .lg-value { grid-template-columns: 1fr; gap: 14px; }
}

.lg-value-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.lg-value-num {
  font-family: "Public Sans", sans-serif;
  font-weight: 700;
  font-size: 34px;
  line-height: 1;
  color: var(--brand);
  letter-spacing: -0.03em;
  flex-shrink: 0;
  min-width: 64px;
  font-feature-settings: "tnum" 1, "lnum" 1;
}
.lg-value-num .lg-value-unit {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 2px;
  letter-spacing: 0.02em;
}
.lg-value-txt {
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
}
.lg-value-txt strong {
  display: block;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
  font-size: 14px;
  letter-spacing: -0.005em;
}

/* Proof-Strip */
.lg-proof {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  padding: 14px 18px;
  background: rgba(42, 179, 179, 0.06);
  border: 1px solid rgba(42, 179, 179, 0.18);
  border-radius: 10px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 24px;
  position: relative;
  z-index: 2;
}
.lg-proof-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 3px rgba(63, 168, 99, 0.18);
  animation: pulseDot 2.4s ease-in-out infinite;
  flex-shrink: 0;
}
.lg-proof-head {
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.14em;
}
.lg-proof-stat { color: var(--ink-2); font-size: 12px; }
.lg-proof-stat strong { color: var(--brand); font-weight: 700; margin-right: 3px; }
.lg-proof-sep { color: var(--muted-2); }

/* Features kleiner + subtiler (sie sind jetzt sekundär) */
.lg-features {
  padding-top: 22px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.06) !important;
  gap: 16px !important;
}
.lg-feat-h { font-size: 15px !important; }
.lg-feat-p { font-size: 11.5px !important; line-height: 1.5 !important; }
.lg-feat-num { font-size: 9px !important; letter-spacing: 0.1em !important; }
/* ═══ END ═══ */


/* ═══ USERS-VIEW · dunkel + Login-History ═══ */
/* Override für hart-codierte helle User-Cards */
#users-list > div[style*="background:#fff"] {
  background: var(--paper) !important;
  border-color: var(--border) !important;
}
#users-list div[style*="color:#1a1a2e"] { color: var(--ink) !important; }
#users-list div[style*="color:#6b7280"] { color: var(--muted) !important; }
#users-list div[style*="color:#9ca3af"] { color: var(--muted) !important; }

/* Login-History-Panel */
.login-history {
  margin-top: 24px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
}
.lh-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
  flex-wrap: wrap;
}
.lh-title {
  font-family: var(--font-display);
  font-variation-settings: normal;
  font-family: "Public Sans", sans-serif;
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lh-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}
.lh-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 380px;
  overflow-y: auto;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.lh-row {
  display: grid;
  grid-template-columns: 120px 1fr 100px 90px 1fr;
  gap: 12px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--ink-2);
  align-items: center;
}
.lh-row:last-child { border-bottom: none; }
.lh-row .lh-when {
  font-family: var(--font-mono);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.lh-row .lh-user { font-weight: 700; color: var(--ink); }
.lh-row .lh-role {
  display: inline-block;
  padding: 1px 8px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
  font-size: 10px;
  font-family: var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  width: fit-content;
}
.lh-row .lh-ip {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--muted-2);
}
.lh-row .lh-ua {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .lh-row { grid-template-columns: 1fr; gap: 2px; padding: 10px 4px; }
  .lh-row .lh-ua { display: none; }
}
/* ═══ END ═══ */


/* ── Multi-Tenant: Site-Switcher ── */
.site-switch-btn {
  background: none;
  border: 1px solid var(--border, rgba(0,0,0,0.1));
  border-radius: 6px;
  padding: 4px 8px;
  margin-left: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  vertical-align: middle;
}
.site-switch-btn:hover {
  background: rgba(10, 138, 138, 0.1);
  border-color: var(--accent, #0a8a8a);
}
.site-switch-item {
  font-family: inherit;
  font-size: 14px;
  width: 100%;
  transition: all 0.15s ease;
}
.site-switch-item:not([data-active="1"]):hover {
  border-color: var(--accent, #0a8a8a) !important;
  transform: translateX(2px);
}

/* Mobile-Anpassung */
@media (max-width: 700px) {
  .site-switch-btn { font-size: 13px; padding: 3px 6px; margin-left: 4px; }
}
