/* ═══════════════════════════════════════════════════════════════════════════
   WWB — Unified Stylesheet  (Light & Dark Mode, Responsive)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens: Light (Default) ──────────────────────────────────────── */
:root {
  --spruce:        #1a3d2b;
  --spruce-mid:    #2a5c40;
  --spruce-light:  #3d7a56;
  --spruce-muted:  rgba(255,255,255,0.07);
  --gold:          #c8922a;
  --gold-light:    #e8b84b;
  --red:           #9b2335;
  --bg:            #faf8f4;
  --bg-card:       #ffffff;
  --text:          #1c1c1c;
  --text-mid:      #5a5a5a;
  --text-muted:    #9a9a9a;
  --border:        #e8e4de;
  --body-bg:       #e8e4de;
  --radius:        6px;
  --sidebar-w:     240px;
  --topbar-h:      54px;
  --font-display:  'Lora', Georgia, serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  /* Semantic state colors */
  --ok-bg:            #d1e7dd;
  --ok-text:          #0a5c34;
  --err-bg:           #f8d7da;
  --err-text:         #842029;
  --warn-bg:          #fff3cd;
  --warn-text:        #664d00;
  --neutral-bg:       #e9ecef;
  --neutral-text:     #333333;
  --badge-bg:         #e0f0e9;
  --progress-neutral: #adb5bd;
  --red-btn:          #b91c1c;
  --red-btn-hover:    #991b1b;
  --sidebar-bg:       var(--spruce);
}

/* ── Design Tokens: Dark ──────────────────────────────────────────────────── */
/* OS fallback — only if user has not pinned light */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --spruce:           #1e4a32;
    --spruce-mid:       #2d6647;
    --spruce-light:     #3d8a5e;
    --spruce-muted:     rgba(255,255,255,0.06);
    --gold:             #c8922a;
    --gold-light:       #e8b84b;
    --red:              #b02a3a;
    --bg:               #141a16;
    --bg-card:          #1c2520;
    --text:             #edeae4;
    --text-mid:         #9e9b94;
    --text-muted:       #5e5c57;
    --border:           #2a302c;
    --body-bg:          #0e1210;
    --ok-bg:            #1a2e22;
    --ok-text:          #6fcf97;
    --err-bg:           #2e1a1a;
    --err-text:         #eb5757;
    --warn-bg:          #2e2a18;
    --warn-text:        #d4a017;
    --neutral-bg:       #2a302c;
    --neutral-text:     var(--text-mid);
    --badge-bg:         #1a2e22;
    --progress-neutral: #3a3f3c;
    --sidebar-bg:       #111c14;
  }
}

/* Manual toggle — always wins */
[data-theme="dark"] {
  --spruce:           #1e4a32;
  --spruce-mid:       #2d6647;
  --spruce-light:     #3d8a5e;
  --spruce-muted:     rgba(255,255,255,0.06);
  --gold:             #c8922a;
  --gold-light:       #e8b84b;
  --red:              #b02a3a;
  --bg:               #141a16;
  --bg-card:          #1c2520;
  --text:             #edeae4;
  --text-mid:         #9e9b94;
  --text-muted:       #5e5c57;
  --border:           #2a302c;
  --body-bg:          #0e1210;
  --ok-bg:            #1a2e22;
  --ok-text:          #6fcf97;
  --err-bg:           #2e1a1a;
  --err-text:         #eb5757;
  --warn-bg:          #2e2a18;
  --warn-text:        #d4a017;
  --neutral-bg:       #2a302c;
  --neutral-text:     var(--text-mid);
  --badge-bg:         #1a2e22;
  --progress-neutral: #3a3f3c;
  --sidebar-bg:       #111c14;
}

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font-body);
  background: var(--body-bg);
  color: var(--text);
}

/* ── Dark-specific component overrides ───────────────────────────────────── */
/* Sidebar ::before decoration — only relevant in dark mode */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar::before { background: rgba(255,255,255,0.035); }
}
[data-theme="dark"] .sidebar::before { background: rgba(255,255,255,0.035); }

/* ════════════════════════════════════════════════════════════════════════════
   SHELL LAYOUT
   ════════════════════════════════════════════════════════════════════════════ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.25s;
}
.overlay.visible { display: block; opacity: 1; }

/* ════════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ════════════════════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  z-index: 50;
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
}

.sidebar::before { display: none; }

/* Mobile: Sidebar als Drawer */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    height: 100%;
    transform: translateX(-100%);
    box-shadow: 4px 0 24px rgba(0,0,0,0.25);
  }
  .sidebar.open {
    transform: translateX(0);
  }
}

.sidebar-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  z-index: 1;
  overflow-y: auto;
  scrollbar-width: none;
}
.sidebar-inner::-webkit-scrollbar { display: none; }

.sidebar-logo {
  padding: 1.4rem 1.25rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: 0.5rem;
  cursor: pointer;
  user-select: none;
}

.logo-img {
  display: block;
  width: 50%;
  height: auto;
  margin: 0 auto;
}

.nav-section-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.3);
  padding: 1rem 1.25rem 0.35rem;
  font-family: var(--font-body);
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.55rem 1.25rem;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.6);
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
  font-family: var(--font-body);
  transition: background 0.12s, color 0.12s;
  border-right: 2px solid transparent;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.nav-link:hover { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.9); }
.nav-link.active {
  background: rgba(200,146,42,0.18);
  color: #fff;
  font-weight: 500;
  border-right-color: var(--gold);
}

.nav-link .icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.55; transition: opacity 0.12s; }
.nav-link.active .icon,
.nav-link:hover .icon { opacity: 1; }


.sidebar-footer {
  margin-top: auto;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 0.5rem 0 0.75rem;
}
.sidebar-footer form { margin: 0; padding: 0; }

.nav-section-admin { display: none; }
.show-admin .nav-section-admin { display: block; }

/* ════════════════════════════════════════════════════════════════════════════
   MAIN AREA
   ════════════════════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: var(--bg);
}

/* Auf Mobile nimmt main die volle Breite ein (Sidebar ist Drawer) */
@media (max-width: 768px) {
  .main { width: 100%; }
}

/* ── Topbar ───────────────────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
  flex-shrink: 0;
  gap: 12px;
}

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

/* Hamburger — nur mobile */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4.5px;
  width: 36px; height: 36px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  transition: background 0.1s;
}
.hamburger:hover { background: var(--bg); }
.hamburger span {
  display: block;
  height: 1.5px;
  background: var(--text-mid);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 768px) { .hamburger { display: flex; } }

.topbar-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

.role-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
  font-family: var(--font-body);
}

/* Theme-Toggle-Button */
.theme-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-mid);
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.theme-toggle-btn:hover { background: var(--spruce-muted); color: var(--text); }
.theme-toggle-btn .icon-sun  { display: none; }
.theme-toggle-btn .icon-moon { display: block; }

[data-theme="dark"] .theme-toggle-btn .icon-sun  { display: block; }
[data-theme="dark"] .theme-toggle-btn .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle-btn .icon-sun  { display: block; }
  :root:not([data-theme="light"]) .theme-toggle-btn .icon-moon { display: none; }
}

@media (max-width: 480px) {
  .btn.secondary { display: none; }
  .role-badge    { display: none; }
  .topbar        { padding: 0 1rem; }
}

/* ── Content ──────────────────────────────────────────────────────────────── */
.content {
  flex: 1;
  padding: 1.75rem;
  overflow-y: auto;
  background: var(--bg);
  -webkit-overflow-scrolling: touch;
}
@media (max-width: 480px) { .content { padding: 1.25rem 1rem; } }

.page-header { margin-bottom: 1.5rem; }

.page-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.page-sub { font-size: 13.5px; color: var(--text-muted); }

/* ════════════════════════════════════════════════════════════════════════════
   BUTTONS
   ════════════════════════════════════════════════════════════════════════════ */
.btn {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-mid);
  transition: background 0.1s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
  display: inline-block;
}
.btn:hover { background: var(--bg); }

.btn.primary, .btn-primary {
  background: var(--spruce);
  color: #fff;
  border-color: var(--spruce);
}
.btn.primary:hover, .btn-primary:hover { background: var(--spruce-mid); }

.btn.gold {
  background: var(--gold);
  color: #fff;
  border-color: var(--gold);
}
.btn.gold:hover { background: var(--gold-light); }

.btn-secondary {
  background: transparent;
  color: var(--spruce-mid);
  border: 1.5px solid var(--spruce-mid);
  border-radius: var(--radius);
  padding: 0.45rem 1rem;
  cursor: pointer;
  font-size: 0.9rem;
  text-decoration: none;
  display: inline-block;
  font-family: var(--font-body);
  transition: background 0.1s;
}
.btn-secondary:hover { background: var(--spruce-muted); }

.btn-small, .btn-sm {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--text);
  margin-right: 0.25rem;
  cursor: pointer;
  font-family: var(--font-body);
  transition: background 0.1s;
}
.btn-small:hover, .btn-sm:hover { background: var(--border); }

.btn-danger {
  background: var(--red-btn);
  border-color: var(--red-btn-hover);
  color: #fff;
}
.btn-danger:hover { background: var(--red-btn-hover); }

.row-actions { white-space: nowrap; }

.form-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.confirm-box {
  max-width: 480px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.confirm-warning {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.confirm-detail {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   STAT CARDS
   ════════════════════════════════════════════════════════════════════════════ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 1.25rem;
}
@media (max-width: 600px) { .stat-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 380px) { .stat-grid { grid-template-columns: 1fr; } }

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem 1.1rem;
}

.stats-grid {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.stats-grid .stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 130px;
}

.stat-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-bottom: 6px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--spruce-mid);
}
.stat-value.green { color: var(--spruce-mid); }
.stat-value.gold  { color: var(--gold); }
.stat-value.red   { color: var(--red); }

.placeholder {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: 10px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-muted);
}

.pipeline-section {
  margin-bottom: 1.75rem;
}

.pipeline-header {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.pipeline-leer {
  font-size: 13px;
  color: var(--text-muted);
  padding: 0.4rem 0;
}

.pipeline-bar {
  display: flex;
  height: 36px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border);
}

.pipeline-segment {
  height: 100%;
  min-width: 4px;
  cursor: default;
  transition: filter 0.15s;
}
.pipeline-segment:hover { filter: brightness(1.15); }

.seg-erfasst     { background: var(--red); }
.seg-gelagert    { background: var(--gold); }
.seg-ausgeliefert { background: var(--spruce-mid); }

.pipeline-tooltip {
  position: fixed;
  display: none;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  color: var(--text);
  pointer-events: none;
  white-space: nowrap;
  z-index: 9999;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

/* ════════════════════════════════════════════════════════════════════════════
   FORMS
   ════════════════════════════════════════════════════════════════════════════ */
fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}
legend { font-weight: 600; padding: 0 0.4rem; font-size: 0.95rem; color: var(--text); }

.field { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.75rem; }
.field label { font-size: 0.85rem; font-weight: 500; color: var(--text-muted); }
.field input, .field select, .field textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  font-size: 0.95rem;
  width: 100%;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 2px solid var(--spruce-light);
  border-color: var(--spruce-light);
}

/* Spinner-Pfeile bei Zahlenfeldern ausblenden */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.field-row { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.75rem; }
.field-row .field { flex: 1; min-width: 140px; }
.field-row .field-small { flex: 0 0 120px; }
.field-error { color: var(--red); font-size: 0.8rem; }
.input-with-prefix { display: flex; gap: 0.5rem; }
.input-with-prefix select { flex: 0 0 auto; width: auto; min-width: 4.5rem; }
.input-with-prefix input { flex: 1; }
.wunsch-block .block-fields { padding-top: 0.75rem; }

/* ════════════════════════════════════════════════════════════════════════════
   TABLE
   ════════════════════════════════════════════════════════════════════════════ */
.table-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.75rem;
}

/* Scrollbare Tabellen-Karte */
.table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}
.table-wrap .data-table { border: none; }
.table-wrap .data-table th,
.table-wrap .data-table td { border-left: none; border-right: none; }
.table-wrap .data-table tr:last-child td { border-bottom: none; }

.search-input {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  width: 100%;
  max-width: 320px;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font-body);
}
.search-input:focus { outline: 2px solid var(--spruce-light); border-color: var(--spruce-light); }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  background: var(--bg-card);
}
.data-table th, .data-table td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.75rem;
  text-align: left;
  color: var(--text);
}
.data-table th { background: var(--bg); font-weight: 600; color: var(--text-mid); }
.data-table tr:hover td { background: var(--bg); }
.empty { color: var(--text-muted); text-align: center; }

.status-select {
  font-size: 0.8rem;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg-card);
}
.status-select.status-0 { background: var(--neutral-bg); color: var(--neutral-text); }
.status-select.status-1 { background: var(--warn-bg);    color: var(--warn-text); }
.status-select.status-2 { background: var(--ok-bg);      color: var(--ok-text); }

/* ════════════════════════════════════════════════════════════════════════════
   BADGES
   ════════════════════════════════════════════════════════════════════════════ */
.badge     { background: var(--badge-bg); color: var(--spruce-mid); font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 99px; margin-right: 0.25rem; }
.badge-ok  { background: var(--ok-bg);   color: var(--ok-text);    font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 99px; }
.badge-err { background: var(--err-bg);  color: var(--err-text);   font-size: 0.75rem; padding: 0.15rem 0.5rem; border-radius: 99px; }

/* ════════════════════════════════════════════════════════════════════════════
   PROGRESS BAR
   ════════════════════════════════════════════════════════════════════════════ */
.progress-section { margin-bottom: 1.5rem; }
.progress-bar-wrap { display: flex; border-radius: var(--radius); overflow: hidden; height: 2rem; }
.progress-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #fff;
  min-width: 1px;
  white-space: nowrap;
  overflow: hidden;
  transition: width 0.4s;
}
.progress-erfasst      { background: var(--progress-neutral); }
.progress-gelagert     { background: var(--gold); }
.progress-ausgeliefert { background: var(--spruce-mid); }

/* ════════════════════════════════════════════════════════════════════════════
   CARD
   ════════════════════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.card > h2:first-child { margin-top: 0; }
.card > p { color: var(--text-muted); font-size: 13.5px; line-height: 1.55; margin-bottom: 0.75rem; }

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* ════════════════════════════════════════════════════════════════════════════
   SECTION BLOCKS
   ════════════════════════════════════════════════════════════════════════════ */
.profil-section,
.druck-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}
.druck-section p { margin-bottom: 0.75rem; color: var(--text-muted); font-size: 0.9rem; }

.info-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.4rem 1rem; }
.info-list dt { font-weight: 600; font-size: 0.875rem; color: var(--text-muted); }
.info-list dd { font-size: 0.95rem; color: var(--text); }
.rolle-liste { list-style: none; display: flex; gap: 0.5rem; flex-wrap: wrap; padding-top: 0.25rem; }

.chart-container {
  min-height: 320px;
  margin-bottom: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }

.chart-card h2 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 1rem;
}
.chart-box {
  position: relative;
  height: 300px;
}
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  font-size: 13px;
  color: var(--text-muted);
}

/* ════════════════════════════════════════════════════════════════════════════
   LOGIN
   ════════════════════════════════════════════════════════════════════════════ */
.login-wrap {
  max-width: 380px;
  margin: 3rem auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
}
.login-wrap h1 { margin-bottom: 1.25rem; font-family: var(--font-display); }

/* ════════════════════════════════════════════════════════════════════════════
   MESSAGES / ALERTS
   ════════════════════════════════════════════════════════════════════════════ */
.messages { list-style: none; margin-bottom: 1rem; }
.message  { padding: 0.65rem 1rem; border-radius: var(--radius); margin-bottom: 0.5rem; }
.success  { background: var(--ok-bg);  color: var(--ok-text); }
.error    { background: var(--err-bg); color: var(--err-text); }
.warn     { background: var(--warn-bg); color: var(--warn-text); }
.hint     { color: var(--text-muted); font-size: 0.875rem; }

/* ════════════════════════════════════════════════════════════════════════════
   SCANNER-BESTÄTIGUNGS-MODAL (Lagerlogistik)
   ════════════════════════════════════════════════════════════════════════════ */
.scan-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.scan-modal {
  width: 100%;
  max-width: 30rem;
}
.scan-modal-daten {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 1rem 0;
}
.scan-modal-daten dt { color: var(--text-muted); font-size: 0.875rem; }
.scan-modal-daten dd { color: var(--text); }
.scan-modal-aktionen {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

/* ════════════════════════════════════════════════════════════════════════════
   TOGGLE-SWITCH (z.B. „Barcodes“ im Etikettendruck)
   ════════════════════════════════════════════════════════════════════════════ */
.toggle-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  user-select: none;
  font-weight: 500;
  color: var(--text);
}
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-switch .toggle-track {
  position: relative;
  flex: 0 0 auto;
  width: 2.4rem;
  height: 1.35rem;
  background: var(--neutral-bg);
  border-radius: 999px;
  transition: background 0.15s ease;
}
.toggle-switch .toggle-track::before {
  content: "";
  position: absolute;
  top: 0.18rem;
  left: 0.18rem;
  width: 0.99rem;
  height: 0.99rem;
  background: var(--bg-card);
  border-radius: 50%;
  box-shadow: 0 1px 2px rgba(0,0,0,0.25);
  transition: transform 0.15s ease;
}
.toggle-switch input:checked + .toggle-track { background: var(--spruce-light); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(1.05rem); }
.toggle-switch input:focus-visible + .toggle-track {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ════════════════════════════════════════════════════════════════════════════
   BARCODE-MOCKUP (Muster-Vorschau im Etikettendruck)
   ════════════════════════════════════════════════════════════════════════════ */
.etk-barcode { display: none; }
.etk-muster.has-barcode .etk-barcode {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  bottom: 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}
.etk-barcode-bars {
  flex: 1 1 auto;
  min-height: 2.5rem;
  width: 1.5rem;
  background: repeating-linear-gradient(
    to bottom,
    var(--text) 0, var(--text) 1px,
    transparent 1px, transparent 3px,
    var(--text) 3px, var(--text) 5px,
    transparent 5px, transparent 6px,
    var(--text) 6px, var(--text) 7px,
    transparent 7px, transparent 10px
  );
}
.etk-barcode-label {
  font-size: 0.55rem;
  letter-spacing: 0.03em;
  color: var(--text);
  white-space: nowrap;
}

h1 { font-size: 1.6rem; margin-bottom: 1.25rem; font-family: var(--font-display); color: var(--text); }
h2 { font-size: 1.2rem; margin-bottom: 0.75rem; color: var(--spruce-mid); font-family: var(--font-display); }

/* ════════════════════════════════════════════════════════════════════════════
   MOBILE BOTTOM NAV
   ════════════════════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: 60px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 30;
  padding: 0 0.5rem;
  align-items: center;
  justify-content: space-around;
}
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  .content    { padding-bottom: 76px; }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 12px;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  border-radius: 8px;
  transition: color 0.12s;
  -webkit-tap-highlight-color: transparent;
  text-decoration: none;
}
.bottom-nav-item svg { width: 20px; height: 20px; stroke: currentColor; fill: none; }
.bottom-nav-item.active { color: var(--spruce-mid); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bottom-nav-item.active { color: var(--gold); }
}
[data-theme="dark"] .bottom-nav-item.active { color: var(--gold); }

/* ════════════════════════════════════════════════════════════════════════════
   NUTZERVERWALTUNG — Profil-Ansicht (normale Nutzer)
   ════════════════════════════════════════════════════════════════════════════ */
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  width: fit-content;
  min-width: min(560px, 100%);
}

.detail-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.detail-row:last-child { border-bottom: none; }

.detail-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-value {
  font-size: 0.9rem;
  color: var(--text);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.tag {
  display: inline-block;
  background: var(--badge-bg);
  color: var(--spruce-mid);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 2px 10px;
  border-radius: 99px;
}

.contact-link {
  color: var(--spruce-light);
  text-decoration: none;
  font-weight: 500;
}
.contact-link:hover { text-decoration: underline; }

/* ════════════════════════════════════════════════════════════════════════════
   NUTZERVERWALTUNG — Inline-Rollen
   ════════════════════════════════════════════════════════════════════════════ */
.inline-rollen-form {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.rollen-checkboxen {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.rolle-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  white-space: nowrap;
}
.rolle-check input[type="checkbox"] {
  accent-color: var(--spruce);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* ════════════════════════════════════════════════════════════════════════════
   ÖFFENTLICHE STARTSEITE (www)
   ════════════════════════════════════════════════════════════════════════════ */
body.landing {
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.landing-theme-toggle {
  position: absolute;
  top: 1rem;
  right: 1rem;
  color: var(--text-mid);
}

.landing-main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
}

.landing-hero {
  text-align: center;
  padding: 2rem 0 2.5rem;
}
.landing-hero-logo {
  width: 130px;
  height: auto;
  margin-bottom: 1.25rem;
}
.landing-hero-title {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--spruce);
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}
.landing-hero-claim {
  font-size: 1.1rem;
  color: var(--gold);
  max-width: 32ch;
  margin: 0 auto;
  line-height: 1.5;
}

.landing-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.landing-section h2 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.75rem;
}
.landing-section p {
  color: var(--text-mid);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}
.landing-section p:last-child { margin-bottom: 0; }
.landing-section a {
  color: var(--spruce-light);
  text-decoration: underline;
}
.landing-section a:hover { color: var(--gold); }

.landing-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem;
}
.landing-footer-nav {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
}
.landing-footer-nav a {
  color: var(--text-mid);
  text-decoration: none;
}
.landing-footer-nav a:hover { color: var(--spruce-light); text-decoration: underline; }
.landing-footer-soon { color: var(--text-muted); }

@media (max-width: 480px) {
  .landing-main { padding: 2rem 1rem 1.5rem; }
  .landing-hero-title { font-size: 1.9rem; }
  .landing-hero-claim { font-size: 1rem; }
}

