@import url('https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3.21.0/dist/tabler-icons.min.css');

/* =============================================================
   WERKBANK — Design System
   Stack: Vanilla CSS, Mobile-First, awork-inspired
   Fonts: Geist (Display + Body)
   ============================================================= */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700;800&display=swap');

/* ── Custom Properties ── */
@import url('./wb-tokens.css?v=wbd351');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
/* Paket A: hidden-Attribut gewinnt immer (vorher überschrieb z. B. .btn{display:inline-flex}
   das hidden — „An Nachunternehmer“ war für Gesellen sichtbar). */
[hidden] { display: none !important; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, textarea, select { font-family: inherit; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { list-style: none; }

/* ── Typografie ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text);
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

.text-display {
  font-family: var(--font-display);
  font-weight: 700;
}

.text-muted   { color: var(--color-text-muted); }
.text-light   { color: var(--color-text-light); }
.text-accent  { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger  { color: var(--color-danger); }

.text-sm  { font-size: var(--text-sm); }
.text-xs  { font-size: var(--text-xs); }
.text-lg  { font-size: var(--text-lg); }
.fw-500   { font-weight: 500; }
.fw-600   { font-weight: 600; }

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-4);
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  transition: background var(--transition), border-color var(--transition),
              box-shadow var(--transition), opacity var(--transition);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--color-accent);
  color: #fff;
  border-color: var(--color-accent);
}
.btn--primary:hover:not(:disabled) {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  box-shadow: none;
}

.btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--color-surface-2);
  border-color: var(--color-border-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--color-text-muted);
  border-color: transparent;
}
.btn--ghost:hover:not(:disabled) {
  background: var(--color-surface-2);
  color: var(--color-text);
}

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

.btn--sm {
  padding: 0.375rem var(--space-3);
  font-size: var(--text-xs);
}

.btn--lg {
  padding: 0.875rem var(--space-6);
  font-size: var(--text-base);
  border-radius: var(--radius-md);
}

.btn--full { width: 100%; }

.btn__spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ── Inputs & Forms ── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.form-label {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.625rem var(--space-3);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--color-text);
  background: var(--color-surface);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--color-focus-ring);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--color-text-light);
}

.form-input--error { border-color: var(--color-danger); }
.form-input--error:focus { box-shadow: 0 0 0 3px var(--color-danger-light); }

.form-hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  font-weight: 500;
}

.form-textarea { resize: vertical; min-height: 100px; line-height: 1.5; }

/* ── Cards ── */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: none;
}

.card--sm { padding: var(--space-4); }
.card--hover {
  transition: box-shadow var(--transition), transform var(--transition);
}
.card--hover:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
  gap: var(--space-3);
}

.card__title {
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}

.card__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

/* ── Badges / Status-Pills ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0.15rem var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.badge--geplant        { background: var(--color-surface-2);     color: var(--color-text-muted); }
.badge--aktiv          { background: var(--color-success-light); color: var(--color-success-text); }
.badge--pausiert       { background: var(--color-warning-light); color: var(--color-warning-text); }
.badge--abgeschlossen  { background: var(--color-surface-2);     color: var(--color-text-muted); }
.badge--archiviert     { background: var(--color-surface-2);     color: var(--color-text-light); }

.badge--offen          { background: var(--color-warning-light); color: var(--color-warning-text); }
.badge--in-arbeit      { background: var(--color-accent-light);  color: var(--color-accent-text); }
.badge--erledigt       { background: var(--color-success-light); color: var(--color-success-text); }
.badge--warten         { background: var(--color-surface-2);     color: var(--color-text-muted); }
.badge--dringend       { background: var(--color-danger-light);  color: var(--color-danger-text); }
.badge--hoch           { background: var(--color-warning-light); color: var(--color-warning-text); }
.badge--mittel         { background: var(--color-surface-2);     color: var(--color-text-muted); }
.badge--niedrig        { background: var(--color-surface-2);     color: var(--color-text-light); }

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}

/* ── Alerts ── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  border: 1px solid transparent;
}

.alert--error   { background: var(--color-danger-light);  border-color: transparent; color: var(--color-danger-text); }
.alert--success { background: var(--color-success-light); border-color: transparent; color: var(--color-success-text); }
.alert--warning { background: var(--color-warning-light); border-color: transparent; color: var(--color-warning-text); }
.alert--info    { background: var(--color-info-light);    border-color: transparent; color: var(--color-info-text); }

/* ── App Layout ── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 50;
  overflow-y: auto;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.sidebar__logo {
  width: 32px; height: 32px;
  background: var(--color-accent);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar__logo svg { color: #fff; }

/* Wenn die Org ein echtes Logo hat: dunkle Träger-Karte mit dem Logo drauf,
   passt sich an die Sidebar-Breite an, Logo ruhig und mittig.
   Default-Träger ist Brand-Akzent (--color-accent), kann pro Org überschrieben werden. */
.sidebar__brand--has-logo {
  display: block !important;
  padding: 4px 0;
}
.sidebar__brand--has-logo .sidebar__logo--img {
  width: 100%;
  height: 48px;
  max-width: 100%;
  background: var(--color-accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
}
.sidebar__logo--img img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
/* Bei Logo-Brand: Logo allein, Subtitle/Brand-Text komplett weg */
.sidebar__brand--has-logo .sidebar__brand-text,
.sidebar__brand--has-logo .sidebar__brand-sub { display: none !important; }
.sidebar__brand--has-logo > div {
  display: none;
}

/* Topbar (Mobile) — Logo statt Text */
.topbar__brand-logo {
  height: 24px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  display: block;
}
.topbar__brand--has-logo {
  display: flex !important;
  align-items: center;
  padding: 4px 0;
}

.sidebar__brand-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1;
}

.sidebar__brand-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-weight: 400;
  margin-top: 2px;
}

.sidebar__nav {
  flex: 1;
  padding: var(--space-4) var(--space-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar__nav-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: var(--space-3) var(--space-2) var(--space-1);
  margin-top: var(--space-2);
}

/* ── Sidebar-Gruppe (Dropdown) ─────────────── */
.sidebar__group { display: flex; flex-direction: column; }
.sidebar__group-toggle {
  display: flex;
  align-items: center;
  width: 100%;
  background: none;
  border: none;
  padding: var(--space-3) var(--space-2);
  margin-top: var(--space-2);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background .15s;
  text-align: left;
  font: inherit;
  color: inherit;
}
.sidebar__group-toggle:hover { background: var(--color-surface-2); }
.sidebar__group-toggle .sidebar__nav-label {
  margin: 0;
  padding: 0;
  flex: 1;
}
.sidebar__group-counter {
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  border-radius: 999px;
  margin-right: var(--space-2);
  min-width: 18px;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar__group-chev {
  color: var(--color-text-light);
  transition: transform .2s ease;
  flex-shrink: 0;
}
.sidebar__group--open .sidebar__group-chev {
  transform: rotate(180deg);
}
.sidebar__group-items {
  display: none;
  flex-direction: column;
  gap: var(--space-1);
  padding-bottom: var(--space-1);
}
.sidebar__group--open .sidebar__group-items {
  display: flex;
  animation: groupExpand .2s ease;
}
@keyframes groupExpand {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar__group-chev { transition: none; }
  .sidebar__group--open .sidebar__group-items { animation: none; }
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  text-decoration: none;
  position: relative;
}

.nav-item:hover {
  background: var(--color-surface-2);
  color: var(--color-text);
  text-decoration: none;
}

.nav-item--active {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.nav-item--active:hover {
  background: var(--color-accent-light);
  color: var(--color-accent);
}

.nav-item__icon {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item--active .nav-item__icon { opacity: 1; }

.nav-badge {
  margin-left: auto;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.sidebar__footer {
  padding: var(--space-4) var(--space-3);
  border-top: 1px solid var(--color-border);
}

/* ── Sidebar Org-Switcher (Super-Admin) ────────────────────────────────── */
.sidebar__org-switcher {
  position: relative;
  margin: 0 var(--space-3) var(--space-2);
  padding-bottom: var(--space-3);
}
.sidebar__org-switcher-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-2, #F4F1ED);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__org-switcher-toggle > span:not([class]) {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}
.sidebar__org-switcher-toggle:hover {
  background: var(--color-surface);
  border-color: var(--color-accent);
  color: var(--color-accent);
}
.sidebar__org-switcher--active .sidebar__org-switcher-toggle {
  background: var(--color-accent-light);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.sidebar__org-switcher-menu {
  position: absolute;
  bottom: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0,0,0,0.12);
  padding: var(--space-2);
  z-index: 60;
  max-height: 320px;
  overflow-y: auto;
}
.sidebar__org-switcher-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  text-align: left;
  transition: background var(--transition);
}
.sidebar__org-switcher-item > span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar__org-switcher-item:hover { background: var(--color-surface-2, #F4F1ED); }
.sidebar__org-switcher-item--active {
  background: rgba(15,42,68,.1);
  color: var(--color-accent);
  font-weight: 700;
}
.sidebar__org-switcher-item--reset {
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}
.sidebar__org-switcher-item--reset:hover { color: var(--color-accent); }
.sidebar__org-switcher-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(15,42,68,.12);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sidebar__org-switcher-pill--muted {
  background: var(--color-surface-2, #F4F1ED);
  color: var(--color-text-muted);
}
.sidebar__org-switcher-sep {
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}

/* ── View-As-Banner (Super-Admin im Fremd-Org-Modus) ──────────────────── */
.wb-view-as-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-text);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
}
.wb-view-as-banner__inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  padding: 8px var(--space-4);
}
.wb-view-as-banner__inner svg { flex-shrink: 0; }
.wb-view-as-banner__btn {
  margin-left: var(--space-3);
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 6px;
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition);
}
.wb-view-as-banner__btn:hover { background: rgba(255,255,255,0.3); }
@media (max-width: 600px) {
  .wb-view-as-banner__inner { font-size: var(--text-xs); flex-wrap: wrap; gap: 6px; padding: 6px 12px; }
  .wb-view-as-banner__btn { font-size: 11px; padding: 3px 8px; }
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar__user:hover { background: var(--color-surface-2); }

.sidebar__avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-accent-light);
  color: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-xs);
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar__user-info { flex: 1; overflow: hidden; }

.sidebar__user-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__user-role {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.page-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-header__title {
  font-size: var(--text-xl);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--color-text);
}

.page-header__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-1);
}

.page-body {
  padding: var(--space-8);
  flex: 1;
}

/* ── Stats Grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-8);
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: none;
  text-decoration: none;
  color: inherit;
  display: block;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.stat-card--link { cursor: pointer; }
.stat-card--link:hover {
  border-color: var(--color-border-strong);
  box-shadow: var(--shadow-sm);
}

.stat-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}

.stat-card__value {
  font-size: var(--text-2xl);
  font-family: var(--font-display);
  font-weight: 650;
  color: var(--color-text);
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.stat-card__sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

.stat-card__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-3);
}

.stat-card__icon--purple { background: var(--color-accent-light); color: var(--color-accent); }
.stat-card__icon--green  { background: var(--color-success-light); color: var(--color-success); }
.stat-card__icon--orange { background: var(--color-warning-light); color: var(--color-warning); }
.stat-card__icon--blue   { background: var(--color-info-light);    color: var(--color-info); }

/* ── Section Grid ── */
.section-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* ── List / Items ── */
.item-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.item-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  transition: background var(--transition), box-shadow var(--transition);
  text-decoration: none;
  color: inherit;
}

.item-row:hover {
  background: var(--color-surface-2);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
}

.item-row__icon {
  width: 36px; height: 36px;
  border-radius: var(--radius);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text-muted);
}

.item-row__body { flex: 1; min-width: 0; }

.item-row__title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-row__meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

.item-row__end {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════ */
/* ── Bottom Nav (Mobile) — iOS App-Icon Style mit Badges ──   */
/* ════════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  padding: 6px 24px max(8px, env(safe-area-inset-bottom)) 24px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
}

.bottom-nav__items {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.bottom-nav .bottom-nav__item {
  flex: 1 1 0;
  min-width: 0;
}

.bottom-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 4px 6px;
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 400;
  background: transparent;
  border: none;
  cursor: pointer;
  transition: color .15s ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav__item:active { opacity: 0.7; }

/* Clean Linien-Icon — kein Background-Tile mehr */
.bottom-nav__pill {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
}

.bottom-nav__item .bn-icon,
.bottom-nav__item svg {
  width: 22px;
  height: 22px;
  color: var(--color-text-muted);
  stroke-width: 1.75;
  filter: none;
  position: relative;
  z-index: 1;
}

.bottom-nav__item--active .bottom-nav__pill {
  transform: none;
  box-shadow: none;
}

.bottom-nav__item--active .bn-icon,
.bottom-nav__item--active svg {
  color: var(--color-accent, #0F2A44);
}

.bottom-nav__label {
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--color-text-muted);
  transition: color .15s ease, font-weight .15s ease;
}

.bottom-nav__item--active .bottom-nav__label {
  color: var(--color-accent, #0F2A44);
  font-weight: 500;
}

.bottom-nav__item--more { font-family: inherit; }

/* Slot-spezifische Farben deaktivieren — alles in Grau bzw. Lila wenn aktiv */
.bottom-nav__item[href*="dashboard"] .bottom-nav__pill,
.bottom-nav__item[href*="baustellen"] .bottom-nav__pill,
.bottom-nav__item[href*="messenger"] .bottom-nav__pill,
.bottom-nav__item--more .bottom-nav__pill,
.bottom-nav__item[href*="stunden"] .bottom-nav__pill,
.bottom-nav__item[href*="aufgaben"] .bottom-nav__pill,
.bottom-nav__item[href*="probleme"] .bottom-nav__pill,
.bottom-nav__item[href*="berichte"] .bottom-nav__pill,
.bottom-nav__item[href*="meldungen"] .bottom-nav__pill,
.bottom-nav__item[href*="team"] .bottom-nav__pill {
  background: transparent;
  box-shadow: none;
}

/* ── iOS-Style Notification-Badge ── */
.bottom-nav__badge {
  position: absolute;
  top: -4px;
  right: 6px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--color-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  box-shadow: none;
  z-index: 2;
  font-variant-numeric: tabular-nums;
}

/* (Aktiv-Indikator-Punkt entfernt — iPhone Home-Indicator überdeckt ihn eh) */

/* ── Bottom Sheet (für „Mehr"-Button) ── */
.bn-sheet {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity .2s ease;
}
.bn-sheet.is-open {
  pointer-events: auto;
  opacity: 1;
}

.bn-sheet__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(2px);
}

.bn-sheet__panel {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: var(--color-surface, #fff);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.18);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.32, .72, 0, 1);
  padding-bottom: env(safe-area-inset-bottom);
}
.bn-sheet.is-open .bn-sheet__panel {
  transform: translateY(0);
}

.bn-sheet__handle {
  width: 44px; height: 5px;
  background: rgba(0, 0, 0, 0.18);
  border-radius: 99px;
  margin: 10px auto 6px;
  cursor: grab;
  flex-shrink: 0;
}
.bn-sheet__handle:active { cursor: grabbing; }

.bn-sheet__inner {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 16px;
  -webkit-overflow-scrolling: touch;
}

/* Sidebar im Bottom-Sheet kompakter darstellen */
.bn-sheet__inner .sidebar__brand { display: none; }
.bn-sheet__inner .sidebar__org-switcher { margin: 8px 16px 12px; }
.bn-sheet__inner .sidebar__nav { padding: 0 12px; }
.bn-sheet__inner .sidebar__nav-label { padding: 12px 12px 6px; font-size: 11px; }
.bn-sheet__inner .sidebar__nav-item {
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 2px;
  min-height: 48px;
}
.bn-sheet__inner .sidebar__nav-item--active {
  background: var(--color-accent-light);
}
.bn-sheet__inner .sidebar__footer { display: none; }
.bn-sheet__inner aside.sidebar {
  position: static !important;
  width: 100% !important;
  height: auto !important;
  border-right: none !important;
  display: block !important;
  background: transparent !important;
  overflow: visible !important;
}

/* ── Top bar (Mobile only) ── */
.topbar {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-4);
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
}

/* ── Loading / Skeleton ── */
.skeleton {
  background: linear-gradient(90deg, var(--color-surface-2) 25%, var(--color-border) 50%, var(--color-surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Spinner ── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.spinner--sm { width: 14px; height: 14px; }
.spinner--lg { width: 32px; height: 32px; border-width: 3px; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ── Empty State ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
  gap: var(--space-4);
}

.empty-state__icon {
  width: 56px; height: 56px;
  border-radius: var(--radius-xl);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-light);
}

.empty-state__title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
}

.empty-state__text {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  max-width: 320px;
}

/* ── Toast ── */
#toast-container {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
  width: calc(100% - var(--space-8));
  max-width: 400px;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.3s ease forwards;
  pointer-events: all;
}

.toast--success { background: var(--color-success-text); color: #fff; }
.toast--error   { background: var(--color-danger-text); color: #fff; }
.toast--info    { background: var(--color-text); color: #fff; }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Divider ── */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

.divider--text {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--color-text-muted);
  font-size: var(--text-xs);
}

.divider--text::before,
.divider--text::after {
  content: '';
  flex: 1;
  border-top: 1px solid var(--color-border);
}

/* ── Utilities ── */
.flex          { display: flex; }
.flex-col      { flex-direction: column; }
.items-center  { align-items: center; }
.items-start   { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── Mobile Responsive ── */
@media (max-width: 768px) {
  /* WICHTIG: app-layout darf auf Mobile kein flex-row sein, sonst quetscht
     Topbar/Sidebar-Mount neben den Content. */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
  }
  .app-layout {
    display: block !important;
    width: 100%;
  }
  .sidebar    { display: none !important; }
  #sidebar-mount { display: none !important; }
  .topbar     { display: flex; }
  .bottom-nav { display: flex; }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    padding-bottom: var(--bottom-nav-height);
    overflow-x: hidden;
  }

  .page-header {
    padding: var(--space-4) var(--space-4);
  }

  .page-body {
    padding: var(--space-3) !important;
    max-width: 100% !important;
    width: 100%;
    margin: 0 !important;
    overflow-x: hidden;
    box-sizing: border-box;
  }

  /* Alle direkten Karten/Sektionen auf Mobile zwingen: keine min-width-Tricks */
  .page-body > *,
  .page-body section,
  .page-body article {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* Page-Title etwas kompakter */
  .page-title { font-size: 22px !important; }
  .page-sub   { font-size: 13px !important; }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-2);
  }

  /* Cards in Stats kompakter */
  .stat-card { padding: var(--space-3); }
  .stat-card__value { font-size: 26px !important; }

  /* Modals voller Höhe */
  .modal { max-width: 100% !important; max-height: 95vh; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-backdrop { align-items: flex-end; }

  /* Form-Inputs größer auf Mobile (Daumen-freundlich, iOS Zoom-fix) */
  .form-input, .form-select, .form-textarea,
  input[type="text"], input[type="number"], input[type="date"], input[type="email"], input[type="tel"], select, textarea {
    font-size: 16px !important; /* iOS verhindert Auto-Zoom bei 16px+ */
  }

  /* Buttons Touch-freundlich */
  .btn, button.btn, .btn--primary, .btn--ghost, .btn--secondary {
    min-height: 44px;
  }

  /* Filter-Bars stapeln */
  .filter-bar { flex-direction: column; align-items: stretch !important; }
  .filter-bar > * { width: 100%; }
  .filter-bar select { max-width: none !important; }

  /* Page-Header-Actions stapeln */
  .page-header { flex-wrap: wrap; gap: var(--space-2); }
  .page-header__actions { width: 100%; }
  .page-header__actions .btn { width: 100%; justify-content: center; }

  #toast-container {
    bottom: calc(var(--bottom-nav-height) + var(--space-3));
    left: var(--space-2); right: var(--space-2);
  }

  /* Tabellen scrollbar machen */
  table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* Sehr schmale Geräte (iPhone SE) */
@media (max-width: 380px) {
  .page-body { padding: var(--space-2); }
  .stats-grid { grid-template-columns: 1fr; }
  .stat-card { padding: var(--space-3); }
}

@media (min-width: 1200px) {
  .section-grid {
    grid-template-columns: 2fr 1fr;
  }
}

/* ============================================================
   Ehemals „WhisperAI-Gradient-Stil" (Verläufe Violett→Pink→Blau).
   Design-System v2: keine Verläufe. Klassen bleiben als ruhige,
   flache Varianten erhalten, falls sie irgendwo noch genutzt werden.
   ============================================================ */
.wb-gradient-text,
.wb-gradient-text--werkbank { color: var(--color-accent); }

.wb-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  border: 1px solid transparent;
}
.wb-pill--violet { background: var(--color-accent-light);  color: var(--color-accent-text); }
.wb-pill--pink   { background: var(--color-accent-light);  color: var(--color-accent-text); }
.wb-pill--blue   { background: var(--color-info-light);    color: var(--color-info-text); }
.wb-pill--mint   { background: var(--color-success-light); color: var(--color-success-text); }
.wb-pill--amber  { background: var(--color-warning-light); color: var(--color-warning-text); }

.wb-hero-gradient,
.wb-hero-gradient--animated {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  position: relative;
  animation: none;
}
.wb-hero-solid {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
}
.wb-hero-solid .wb-hero-solid__title { font-family: var(--font-display); font-weight: 700; font-size: 24px; line-height: 1.2; }
.wb-hero-solid .wb-hero-solid__sub   { color: var(--color-text-muted); margin-top: 6px; font-size: 14px; }

/* ============================================================
   Klickbare Elemente — kein Text-Cursor/Caret
   Browser zeigt sonst beim Klick auf <div onclick="..."> einen
   blinkenden Caret, als ob man Text eintippen könnte.
   ============================================================ */
[onclick],
[role="button"],
button,
.btn,
.aufgabe-card,
.kunden-card,
.baustelle-card,
.bs-stat-card,
.bd-stat-card,
.detail-tab,
.pill,
.tab,
.nav-item,
.li-item,
.bericht-row,
.kontakt-card,
.mp-card,
.mp-sub-card,
.mp-item--clickable,
.switch-card,
[data-action],
[data-baustelle-id],
[data-aufgabe-id],
[data-problem-id],
[data-mappe-id],
[data-pin-id],
[data-plan-open],
[data-foto-open],
[data-doc-open],
[data-bericht-open] {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  caret-color: transparent;
}

/* Inputs + Textareas + contenteditable behalten ihren Caret */
input, textarea, [contenteditable="true"], .form-input, .form-textarea {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  user-select: text !important;
  caret-color: auto !important;
}

/* Manche Container haben role="button" wegen A11y — Caret weg trotzdem */
:focus { caret-color: auto; }
button:focus, [onclick]:focus, [role="button"]:focus { caret-color: transparent; }

/* Hammer-Regel: globaler Caret-Block für alles außer echte Inputs */
*:not(input):not(textarea):not([contenteditable="true"]) {
  caret-color: transparent;
}
input, textarea, [contenteditable="true"] { caret-color: auto !important; }

/* ───── Sidebar-Favoriten (v66+) ───── */
.nav-item__fav {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  color: #94a3b8;
  opacity: 0;
  transition: opacity .15s ease, background .15s ease, color .15s ease, transform .12s ease;
  padding: 0;
}
.nav-item:hover .nav-item__fav,
.nav-item__fav--active {
  opacity: 1;
}
.nav-item__fav:hover {
  background: var(--color-surface-2);
  color: var(--color-accent);
}
/* Angeheftet: nur beim Überfahren sichtbar — keine Dauer-Deko in der Liste */
.nav-item__fav--active {
  color: var(--color-text-light);
  opacity: 0;
}
.nav-item:hover .nav-item__fav--active { opacity: 1; }
.nav-item__fav--active:hover {
  color: var(--color-accent);
}

/* Wenn ein Badge UND ein Stern da sind → Badge nicht direkt am Rand */
.nav-item .nav-badge {
  margin-right: 22px;
}

/* Favoriten-Sektion */
.sidebar__group--fav .sidebar__nav-label {
  color: var(--color-text-light);
}
.sidebar__fav-empty {
  font-size: 11px;
  color: var(--color-text-light, #94a3b8);
  line-height: 1.45;
  padding: 8px 10px 4px;
  font-style: italic;
}

/* ───── Topbar Desktop (v68+ — Suche mittig) ───── */
.topbar {
  display: flex !important;
  align-items: center;
  gap: var(--space-4);
  padding: 0 var(--space-5);
  height: var(--topbar-height);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar__brand {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  min-width: 120px;
}
/* Brand-Titel in Topbar generell verstecken (Page-Header trägt den Titel — auch auf Mobile) */
.topbar__brand--mobile { display: none !important; }
@media (min-width: 901px) {
  /* Such-Pill bekommt den frei werdenden Platz */
  .topbar__search { margin: 0; max-width: 560px; }
}

/* Suche-Pill: vollwertiges Suchfeld-Look */
.topbar__search {
  flex: 1;
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  background: var(--color-surface-2, #F4F1ED);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--color-text-muted, #6b7280);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.topbar__search:hover {
  background: var(--color-surface, #fff);
  border-color: var(--color-accent);
  color: var(--color-text);
}
.topbar__search svg { flex-shrink: 0; opacity: .7; }
.topbar__search-placeholder {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__search-kbd {
  flex-shrink: 0;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 500;
  font-family: var(--font-mono, monospace);
  color: var(--color-text-muted, #6b7280);
}

/* Mobile-Variante als Icon-only — !important wegen JS-injizierten Regeln in sidebar.js/global-search.js */
.topbar__search-btn--mobile { display: none !important; }

/* Auf Mobile: Pill ausblenden, Icon zeigen */
@media (max-width: 900px) {
  .topbar__search { display: none !important; }
  .topbar__search-btn--mobile {
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto !important;
    margin-right: 0 !important;
    width: 38px; height: 38px;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 50% !important;
    color: var(--color-text-muted);
    cursor: pointer;
    flex-shrink: 0;
  }
  .topbar__search-btn--mobile:hover {
    background: var(--color-surface-2);
    color: var(--color-accent);
  }
}

/* Sehr klein: Brand verkürzen damit Topbar nicht überläuft */
@media (max-width: 480px) {
  .topbar__brand { min-width: 0; font-size: 15px; }
}

/* Alten Sidebar-Search-Trigger ausblenden falls noch im Markup */
.sidebar__search-trigger { display: none !important; }


/* ═════════════════════════════════════════════════════════════════════
   DESIGN-REFRESH v74 — Polish-Layer
   Konsistente Radien · weichere Hover-Akzente · flachere Karten
   ═════════════════════════════════════════════════════════════════════ */

/* ── Konsistente Border-Radien override ── */
/* Radien kommen jetzt ausschließlich aus wb-tokens.css (6/8/10/12/16). */

/* ── Karten: flacher mit subtiler Border statt Shadow ── */
.panel,
.dtile,
.welcome,
section.widget > .panel,
section.widget > .mein-tag {
  box-shadow: none !important;
}
.panel {
  border: 1px solid rgba(0,0,0,.06);
}
.dtile {
  border: 1px solid rgba(0,0,0,.06) !important;
  box-shadow: none !important;
  transition: background .15s ease, transform .15s ease, border-color .15s ease !important;
}
.dtile:hover {
  background: var(--color-surface) !important;
  border-color: var(--color-border-strong) !important;
  transform: none !important;
}

/* ── Topbar: dünnere Trennlinie ── */
.topbar {
  border-bottom: 1px solid rgba(0,0,0,.05) !important;
}

/* ── Sidebar Group-Headers: kein CAPS, weicher ── */
.sidebar__nav-label {
  text-transform: none !important;
  letter-spacing: 0.01em !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  color: #8a8580 !important;
}
.sidebar__group-toggle {
  padding: 8px 12px !important;
}
.sidebar__group-toggle:hover {
  background: rgba(0,0,0,.025) !important;
}

/* ── Hover-Akzente generell weicher ── */
.nav-item:hover {
  background: rgba(15,42,68,.06) !important;
  color: var(--color-text) !important;
}
.nav-item--active {
  background: rgba(15,42,68,.10) !important;
  color: var(--color-accent) !important;
}

/* ── Buttons dezenter ── */
.dash-edit-toggle {
  border: 1px solid rgba(0,0,0,.08) !important;
  background: transparent !important;
  color: var(--color-text-muted) !important;
  font-weight: 500 !important;
}
.dash-edit-toggle:hover {
  background: rgba(15,42,68,.06) !important;
  border-color: rgba(15,42,68,.25) !important;
  color: var(--color-accent) !important;
}

/* ── Welcome-Banner: straffer ── */
.welcome {
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 14px !important;
  padding: 16px 20px !important;
}
.welcome::before { display: none !important; }
.welcome__avatar {
  width: 40px !important;
  height: 40px !important;
  border-radius: 10px !important;
  font-size: 14px !important;
  border: none !important;
  background: rgba(15,42,68,.10) !important;
}
.welcome__name {
  font-size: 20px !important;
  font-weight: 600 !important;
}
.welcome__status {
  padding: 6px 12px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
}
.welcome__status--warn {
  background: transparent !important;
  border-color: rgba(15,42,68,.18) !important;
}

/* ── Stats-Grid: 4 statt 6 Tiles, höher, mit Icon ── */
.dash-stats {
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
}
@media (max-width: 1100px) { .dash-stats { grid-template-columns: repeat(2, 1fr) !important; } }
@media (max-width: 600px)  { .dash-stats { grid-template-columns: repeat(2, 1fr) !important; } }

.dtile {
  padding: 14px 16px !important;
  border-radius: 12px !important;
  gap: 2px !important;
}
.dtile__icon {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--color-surface-2);
  color: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-size: 18px;
}
/* Kachel-Icons einheitlich neutral — Farbe trägt nur die Zahl/der Sub-Text, wenn es wirklich kritisch ist */
.dtile__icon,
.dtile__icon--warn,
.dtile__icon--danger,
.dtile__icon--info,
.dtile__icon--success { background: var(--color-surface-2); color: var(--color-text-muted); }
.dtile__value {
  font-size: 24px !important;
  font-weight: 650 !important;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em !important;
}
.dtile__label {
  font-size: 12px !important;
  color: var(--color-text-muted) !important;
  font-weight: 500 !important;
  margin-top: 2px !important;
}
.dtile__sub {
  font-size: 11px !important;
  color: var(--color-text-light) !important;
  margin-top: 2px !important;
}
.dtile__open { display: none !important; }

/* Mein-Tag-Widget: weichere Box ohne Verlauf-Hintergrund */
.mein-tag {
  background: var(--color-surface) !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 14px !important;
}

/* Page-Header: subtilere Border */
.page-header {
  border-bottom-color: rgba(0,0,0,.05) !important;
}

/* ───── Pin-Style Refinement (v75) ───── */
.nav-item__fav i.ti {
  transition: transform .15s ease, color .15s ease;
  display: inline-block;
}
.nav-item__fav--active i.ti {
  transform: rotate(-30deg);
}
/* Pin in Favoriten-Sektion gibt es nicht mehr — extra ausgeblendet falls noch im DOM */
.sidebar__group--fav .nav-item__fav { display: none !important; }
.sidebar__group--fav .nav-item .nav-badge { margin-right: 0 !important; }

/* ════════════════════════════════════════════════════════════ */
/* ── Portal-Switcher (Baustellen ↔ CRM) ──                    */
/* ════════════════════════════════════════════════════════════ */
.sidebar__portal-switcher {
  display: flex; gap: 4px;
  padding: 0 var(--space-3) var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-2);
}
.sidebar__portal-btn {
  flex: 1;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 12px; font-weight: 600;
  color: var(--color-text-muted);
  background: transparent;
  text-decoration: none;
  transition: all .12s;
  border: 1px solid transparent;
}
.sidebar__portal-btn:hover { background: rgba(0,0,0,.03); color: var(--color-text); }
.sidebar__portal-btn--active {
  background: var(--color-accent-light, rgba(15,42,68,.10));
  color: var(--color-accent);
  border-color: rgba(15,42,68,.18);
}
.sidebar__portal-btn--active svg { color: var(--color-accent); }

/* ═════════════════════════════════════════════════════════════════════
   DESIGN-SYSTEM v2 (Okt 2026) — Basis-Schicht
   Ruhig, professionell: eine Akzentfarbe, Linien statt Schatten,
   keine Hüpf-Hover, Zahlen in Tabellenziffern.
   Steht bewusst am Ende von werkbank.css; seitenspezifische <style>-Blöcke
   laden danach und dürfen weiterhin gezielt überschreiben.
   ═════════════════════════════════════════════════════════════════════ */

/* Typo-Hierarchie */
.page-header__title,
.page-title { font-size: var(--text-xl); font-weight: 700; letter-spacing: -.01em; }
.page-header__subtitle,
.page-sub { color: var(--color-text-muted); }
td, .num, [class*="__value"], [class*="-value"] { font-variant-numeric: tabular-nums; }

/* Fokus sichtbar, aber ruhig */
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* Buttons: sekundär ist Standard, Primär nur für die Haupthandlung */
.btn--primary:active:not(:disabled) { background: var(--color-accent-hover); }
.btn--secondary { border-color: var(--color-border-strong); }

/* Karten & Panels: einheitliche Linie, kein Schweben */
.panel { border-color: var(--color-border) !important; }
.card--hover:hover, .stat-card--link:hover { transform: none; }

/* Status-Badges: kleiner Punkt nur bei Status, nicht bei Prioritäten */
.badge--hoch::before, .badge--mittel::before, .badge--niedrig::before, .badge--dringend::before { display: none; }

/* Mobile Portal-Tabs + Badges aus sidebar.js: Akzent statt Signalrot */
.topbar__msg-badge { background: var(--color-accent) !important; font-weight: 600 !important; }
.bottom-nav__badge { background: var(--color-text); }
.bottom-nav__badge[data-badge-for="probleme_kritisch"] { background: var(--color-danger); }
.topbar__portal-tab--active { background: var(--color-accent-light) !important; }

/* Leere Zustände: ruhig, zentriert, ohne Emoji-Größe */
.empty-state__icon { border-radius: var(--radius-lg); }

/* ── Filterleisten: auf Desktop nebeneinander statt volle Breite ──
   (.form-select hat width:100% → in .filter-bar stapelte sich jede Auswahl
   als eigene Zeile, z. B. Belege prüfen, Fuhrpark, Geräte) */
@media (min-width: 769px) {
  .filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); }
  .filter-bar > .form-select,
  .filter-bar > select,
  .filter-bar > .form-input,
  .filter-bar > input[type="text"],
  .filter-bar > input[type="search"] { width: auto; flex: 0 1 220px; min-width: 160px; }
}

/* ── Handy: nichts darf breiter als der Bildschirm werden ── */
@media (max-width: 768px) {
  .main-content > *:not(.msg-wrap-outer) { max-width: 100%; min-width: 0; }
  .form-row__row2 { grid-template-columns: 1fr !important; }
}

/* Icons in Buttons nie selbst Klickziel — viele Handler prüfen ev.target.id */
button .ti, .btn .ti, a.btn .ti { pointer-events: none; }
.btn .ti { font-size: 1.1em; line-height: 1; }

/* Priorität als ruhiger Balken (statt Flammen-Emoji) — 1 bis 3 */
.wb-prio { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; vertical-align: middle; margin-left: 4px; }
.wb-prio__bar { display: block; width: 3px; border-radius: 1px; background: var(--color-border-strong); }
.wb-prio__bar:nth-child(1) { height: 5px; }
.wb-prio__bar:nth-child(2) { height: 8px; }
.wb-prio__bar:nth-child(3) { height: 12px; }
.wb-prio__bar.is-on { background: var(--color-warning); }


/* v329: Linien-Icons ohne Anführungszeichen (<i class=ti-NAME>) — ersetzt Emojis */
i[class^="ti-"], i[class*=" ti-"] {
  font-family: "tabler-icons" !important; font-style: normal; font-weight: normal;
  font-variant: normal; text-transform: none; line-height: 1; display: inline-block;
  vertical-align: -0.125em; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* v331: Handy — oben links Werkbank-Zeichen bzw. Firmenlogo statt leerer Fläche */
@media (max-width: 900px) {
  .topbar__brand--zeichen { display: flex !important; align-items: center; min-width: 0 !important; margin-right: auto; text-decoration: none; padding: 4px 0; }
  .topbar__brand--zeichen svg { display: block; height: 22px; width: auto; }
  .topbar__brand--zeichen .topbar__brand-logo { height: 28px; max-width: 150px; }
}

/* v332: „+“ Schnell-Erfassen in der unteren Leiste */
.bottom-nav__plus {
  flex: 0 0 auto; width: 56px; height: 56px; border-radius: 18px; border: none;
  background: var(--color-copper, #B87333); color: #FFFFFF; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(15,42,68,.22); margin: -10px 4px 0; cursor: pointer;
}
.bottom-nav__plus .ti { font-size: 28px; }
.bottom-nav__plus:active { transform: scale(.94); }
.wb-schnell { position: fixed; inset: 0; z-index: 900; background: rgba(15,42,68,0); transition: background .2s; display: flex; align-items: flex-end; }
.wb-schnell--offen { background: rgba(15,42,68,.45); }
.wb-schnell__panel { width: 100%; background: var(--color-surface, #fff); border-radius: 22px 22px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s cubic-bezier(.32,.72,0,1); }
.wb-schnell--offen .wb-schnell__panel { transform: translateY(0); }
.wb-schnell__griff { width: 40px; height: 4px; border-radius: 2px; background: var(--color-border-strong, #CBC8BF); margin: 0 auto 12px; }
.wb-schnell__titel { font-weight: 700; font-size: 17px; margin: 0 4px 12px; color: var(--color-text); }
.wb-schnell__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.wb-schnell__item { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px; border-radius: 14px;
  border: 1px solid var(--color-border); text-decoration: none; color: var(--color-text); font-size: 14px; font-weight: 600; min-height: 96px; justify-content: center; }
.wb-schnell__item:active { background: var(--color-surface-2); }
.wb-schnell__icon { width: 48px; height: 48px; border-radius: 14px; background: var(--color-accent-light, #E7ECF2); color: var(--color-accent);
  display: flex; align-items: center; justify-content: center; }
.wb-schnell__icon .ti { font-size: 26px; }
.wb-schnell__zu { width: 100%; margin-top: 12px; min-height: 48px; border-radius: 12px; border: 1px solid var(--color-border);
  background: transparent; font: inherit; font-weight: 600; color: var(--color-text-muted); }
/* Der schwebende Mikro-Knopf geht im „+“ auf (nur Handy) */
@media (max-width: 768px) { .wbs-fab { display: none !important; } }
.wb-puls { animation: wbPuls 1.4s ease-in-out 3; box-shadow: 0 0 0 0 rgba(184,115,51,.6); }
@keyframes wbPuls { 0% { box-shadow: 0 0 0 0 rgba(184,115,51,.55); } 70% { box-shadow: 0 0 0 14px rgba(184,115,51,0); } 100% { box-shadow: 0 0 0 0 rgba(184,115,51,0); } }

/* ══ v333: Gemeinsame kompakte Liste + einheitliche Status-Anzeige ══════════
   .wb-liste > .wb-zeile  — eine Fläche mit Trennlinien statt Einzelkarten.
   .wb-status--offen|arbeit|ueberfaellig|erledigt|genehmigt|problem|abgelehnt|neutral
   — überall gleiche Farbe, Form, Bezeichnung. Farbe nie allein: immer mit Text. */
.wb-liste { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 14px; overflow: hidden; }
.wb-zeile { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; column-gap: 12px; row-gap: 10px;
  align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--color-border); min-height: 60px;
  color: inherit; text-decoration: none; }
.wb-zeile:last-child { border-bottom: none; }
a.wb-zeile:hover, a.wb-zeile:active { background: var(--color-surface-2); }
.wb-zeile__avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--color-accent-light); color: var(--color-accent);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.wb-zeile__main { min-width: 0; }
.wb-zeile__titel { font-weight: 600; font-size: 15px; color: var(--color-text); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wb-zeile__sub { font-size: 13px; color: var(--color-text-muted); line-height: 1.35; margin-top: 2px; }
.wb-zeile__notiz { font-size: 13px; color: var(--color-text-muted); font-style: italic; margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.wb-zeile__ende { display: flex; align-items: center; gap: 6px; color: var(--color-text-light); flex-shrink: 0; }
.wb-zeile__betrag { font-weight: 700; font-size: 15px; color: var(--color-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wb-zeile__aktionen { grid-column: 2 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .wb-zeile__aktionen { grid-column: 1 / -1; flex-wrap: nowrap; }
  .wb-zeile__aktionen .btn { flex: 1 1 0; min-height: 44px; justify-content: center; }
}
.wb-status { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px;
  font-size: 12px; font-weight: 600; white-space: nowrap; line-height: 1; }
.wb-status::before { content: ''; width: 6px; height: 6px; border-radius: 3px; background: currentColor; }
.wb-status--offen        { background: var(--color-warning-light); color: var(--color-warning-text); }
.wb-status--arbeit       { background: var(--color-accent-light);  color: var(--color-accent); }
.wb-status--ueberfaellig { background: var(--color-danger-light);  color: var(--color-danger-text); }
.wb-status--problem      { background: var(--color-danger-light);  color: var(--color-danger-text); }
.wb-status--abgelehnt    { background: var(--color-danger-light);  color: var(--color-danger-text); }
.wb-status--erledigt, .wb-status--genehmigt { background: var(--color-success-light); color: var(--color-success-text); }
.wb-status--neutral      { background: var(--color-surface-2);     color: var(--color-text-muted); }

/* v337: Favoriten-Pin nur mit Maus (Desktop). Auf dem Handy erscheint er sonst beim Antippen
   als „Hover“-Rest und lenkt ab. Die Favoriten-Liste selbst bleibt sichtbar. */
@media (hover: none), (max-width: 768px) {
  .nav-item__fav { display: none !important; }
  .sidebar__fav-empty { display: none !important; }
}

/* v343 — Filter-/Tab-Leisten auf dem Handy: einzeilig, wischbar, überall gleich */
@media (max-width: 700px) {
  html body :is(.filter-pills, .pill-row, .errlog-filter, .filter-bar__pills, .filter-tabs,
    .msg-channels__filters, .filter-chips, .kd-typ-chips, .na-typ-chips,
    .tabs, .fd-tabs, .dk-tabs, .au-tabs, .sk-tabs) {
    display: flex !important; flex-wrap: nowrap !important;
    overflow-x: auto !important; overflow-y: hidden !important;
    max-width: none !important; width: auto !important; min-width: 0 !important;
    /* bis an die Kartenkante (page-body-Padding 12px), rechts weich ausblenden */
    margin-left: -12px !important; margin-right: -12px !important;
    padding-left: 12px !important; padding-right: 12px !important;
    padding-top: 2px !important; padding-bottom: 4px !important;
    box-sizing: border-box;
    gap: 8px; scrollbar-width: none; -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y; overscroll-behavior-x: contain;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
            mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
  }
  html body :is(.filter-pills, .pill-row, .errlog-filter, .filter-bar__pills, .filter-tabs,
    .msg-channels__filters, .filter-chips, .kd-typ-chips, .na-typ-chips,
    .tabs, .fd-tabs, .dk-tabs, .au-tabs, .sk-tabs)::-webkit-scrollbar { display: none; }
  html body :is(.filter-pills, .pill-row, .errlog-filter, .filter-bar__pills, .filter-tabs,
    .msg-channels__filters, .filter-chips, .kd-typ-chips, .na-typ-chips,
    .tabs, .fd-tabs, .dk-tabs, .au-tabs, .sk-tabs) > * {
    flex: 0 0 auto !important; white-space: nowrap !important;
  }
  html body :is(.filter-pills, .pill-row, .errlog-filter, .filter-bar__pills, .filter-tabs,
    .msg-channels__filters, .filter-chips, .kd-typ-chips, .na-typ-chips,
    .tabs, .fd-tabs, .dk-tabs, .au-tabs, .sk-tabs) > *:last-child { margin-right: 24px !important; }
}

/* ════════════════════════════════════════════════════════════
   v349 Design-Reste: EIN Badge-Format für die ganze App
   Regel: Status/Priorität = Pille (rund, normale Schreibweise, 12 px).
          Etiketten wie Gewerk, Kategorie, Kennzeichen = eckig (bleiben).
   body-Präfix, damit es seiteneigene Styles sicher überstimmt.
   ════════════════════════════════════════════════════════════ */
body .badge,
body .status-badge,
body .prio-badge {
  border-radius: 9999px;
  text-transform: none;
  letter-spacing: 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  padding: 2px 10px;
}
body .prio-badge { height: auto; }
body .prio-dringend { background: var(--color-danger-light);  color: var(--color-danger-text); }
body .prio-hoch     { background: var(--color-warning-light); color: var(--color-warning-text); }
body .prio-mittel   { background: var(--color-surface-2);     color: var(--color-text-muted); }
body .prio-niedrig  { background: var(--color-surface-2);     color: var(--color-text-light); }
body .status-entwurf { color: var(--color-text-muted); }

/* ── Paket B (04.11.2026): Seiten-Reiter — Seiten einer Menü-Gruppe ───────
   z. B. Team [Team | Akten | Skills | Dokumente | Onboarding]. Eingehängt von
   js/wb-seitenreiter.js unter dem Seitenkopf. Handy: waagerecht wischen. */
.wb-seitenreiter { margin: 12px 0 16px; min-width: 0; max-width: 100%; }
.wb-seitenreiter--rand { margin: 12px var(--space-6, 24px) 4px; }   /* nur ohne erkennbaren Seitenkopf */
.wb-seitenreiter__leiste {
  display: flex; gap: 4px; padding: 4px; overflow-x: auto; scrollbar-width: none;
  -webkit-overflow-scrolling: touch; overscroll-behavior-x: contain;
  background: var(--color-surface-2, #EDEFF2); border-radius: 12px; width: max-content; max-width: 100%;
}
.wb-seitenreiter__leiste::-webkit-scrollbar { display: none; }
.wb-seitenreiter__reiter {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: 9px; white-space: nowrap;
  font-size: 14px; font-weight: 600; text-decoration: none;
  color: var(--color-text-muted, #56616E);
}
.wb-seitenreiter__reiter:hover { color: var(--color-text, #1A1D21); background: rgba(15, 42, 68, .05); }
.wb-seitenreiter__reiter:focus-visible { outline: 2px solid var(--color-accent, #0F2A44); outline-offset: 1px; }
.wb-seitenreiter__reiter.is-aktiv {
  background: var(--color-surface, #fff); color: var(--color-accent, #0F2A44);
  box-shadow: 0 1px 2px rgba(15, 42, 68, .12);
}
.wb-seitenreiter__zahl {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: #ef4444; color: #fff; font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
}
@media (max-width: 768px) {
  .wb-seitenreiter { margin: 8px 0 12px; }
  .wb-seitenreiter--rand { margin: 8px 16px 4px; }
  .wb-seitenreiter__leiste { width: auto; }
  .wb-seitenreiter__reiter { padding: 0 14px; }
}
/* Link „Benachrichtigungen einstellen“ unten in der Seitenleiste / im Mehr-Sheet */
.sidebar__foot-link {
  display: flex; align-items: center; gap: 8px; margin: 4px 12px 0; padding: 10px 12px; min-height: 44px;
  border-radius: 8px; font-size: 13px; color: var(--color-text-muted, #56616E); text-decoration: none;
}
#bn-sheet .sidebar__foot-link, aside.sidebar .sidebar__foot-link { text-decoration: none; }
.sidebar__foot-link:hover, .sidebar__foot-link--active { background: rgba(15, 42, 68, .06); color: var(--color-text, #1A1D21); }
