/* GuardDesk v2 – Dark-Mode, Mobile-First (Schwarz / Dunkelrot / Silbergrau) */
:root {
  --bg: #0b0b0d;
  --surface: #15151a;
  --surface-2: #1d1d24;
  --surface-3: #25252e;
  --border: #2a2a33;
  --border-light: #383843;
  --text: #e9e9ee;
  --text-muted: #a2a2af;
  --text-dim: #71717c;
  --silver: #c8c8d2;
  --primary: #c01430;
  --primary-700: #8d0e23;
  --primary-500: #c01430;
  --primary-400: #e6536b;
  --primary-glow: rgba(192, 20, 48, .35);
  --green: #2faa5a;
  --amber: #d6a032;
  --red: #d8473f;
  --radius: 14px;
  --bottomnav-h: 60px;
  --topbar-h: 56px;
  color-scheme: dark; /* native Formularelemente in Dunkel rendern */
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-400); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0; }
.muted { color: var(--text-muted); }
.spacer { flex: 1; }

/* ---------------- Topbar ---------------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: rgba(17,17,22,.96); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); font-weight: 700; }
.brand .logo {
  width: 30px; height: 30px; border-radius: 7px; object-fit: contain; display: block;
  box-shadow: 0 4px 14px var(--primary-glow);
}
/* Eigenes Firmenlogo: ohne roten Glow, ohne Border-Radius, max-Breite ausnutzen */
.brand .logo-custom {
  width: auto; height: 30px; max-width: 140px; border-radius: 0;
  object-fit: contain; box-shadow: none; background: transparent;
}
.side-brand-logo-custom {
  width: auto !important; max-width: 38px; max-height: 38px;
  border-radius: 0 !important; object-fit: contain; box-shadow: none !important;
}
.auth-logo-custom {
  width: auto !important; height: auto !important;
  max-width: 180px !important; max-height: 100px !important;
  border-radius: 0 !important; object-fit: contain; box-shadow: none !important;
}
.brand .name { font-size: 1.02rem; letter-spacing: .2px; }
.topbar-object {
  height: 38px; max-width: 230px; padding: 0 10px; margin-right: 10px;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border-light);
  border-radius: 9px; font-size: .85rem; font-weight: 600;
}
@media (max-width: 640px) { .topbar-object { max-width: 150px; } }
.whoami { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.whoami strong { font-size: .85rem; }
.whoami small { color: var(--text-dim); font-size: .7rem; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px;
  color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
}
.icon-btn:hover { border-color: var(--primary-700); }

/* ---------------- Main / Bottom-Nav ---------------- */
.main { max-width: 1100px; margin: 0 auto; padding: 16px 14px calc(var(--bottomnav-h) + 24px); }
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottomnav-h);
  display: flex; background: rgba(17,17,22,.97); backdrop-filter: blur(10px);
  border-top: 1px solid var(--border); z-index: 40;
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; color: var(--text-muted); font-size: .68rem; font-weight: 600;
}
.bottom-nav a.active { color: #fff; }
.bottom-nav a.active .ico { color: var(--primary-400); }

/* ---------------- Cards / Page ---------------- */
.page-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; margin-bottom: 14px;
}
.card.mb-1 { margin-bottom: 8px; }
.card-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 10px; }
.card-title svg { color: var(--primary-400); }

/* ---------------- Stat-Grid ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; text-align: center;
}
.stat-card .ico { color: var(--primary-400); }
.stat-card .val { font-size: 1.7rem; font-weight: 800; margin-top: 4px; }
.stat-card .lbl { color: var(--text-muted); font-size: .8rem; }

/* ---------------- Quick-Cards (Schnellzugriff) ---------------- */
.quick-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 14px; }
.quick-card {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px; color: var(--text); transition: border-color .15s, transform .15s;
}
.quick-card:hover { border-color: var(--primary-700); transform: translateY(-1px); }
.quick-card .ico { color: var(--primary-400); }
.quick-card .t { font-weight: 700; font-size: 1rem; }
.quick-card .d { color: var(--text-muted); font-size: .82rem; }
@media (min-width: 760px) {
  .quick-grid { grid-template-columns: repeat(3, 1fr); }
}
.quick-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-glow); }

/* ---------------- Aktives Objekt (Sidebar/Hamburger) ---------------- */
.side-object { padding: 12px; border-bottom: 1px solid var(--border); }
.side-object-label { display: block; font-size: .7rem; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 6px; }
.side-object select { width: 100%; }
.side-object-single { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--text); }
.side-object-single svg { color: var(--primary-400); }

/* ---------------- Fortschrittsbalken ---------------- */
.progress { width: 100%; height: 10px; background: var(--surface-3); border-radius: 999px; overflow: hidden; }
.progress .bar { height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-400)); border-radius: 999px; transition: width .3s; }

/* ---------------- Mitarbeiter-Startseite (Objekt-Kacheln) ---------------- */
.obj-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .obj-grid { grid-template-columns: repeat(2, 1fr); } }
.obj-card { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.obj-main { display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.obj-main:hover .obj-name { color: var(--primary-400); }
.obj-name { font-size: 1.05rem; font-weight: 800; }
.obj-cust { color: var(--text-muted); font-size: .82rem; }
.obj-card .obj-start { width: 100%; }
.obj-rounds { display: flex; flex-direction: column; gap: 8px; }
.obj-rounds[hidden] { display: none; }
.obj-rounds .btn { width: 100%; }

/* ---------------- Modal (Rundgang-Auswahl u. ä.) ---------------- */
.modal { position: fixed; inset: 0; z-index: 1300; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.6); }
.modal[hidden] { display: none; }
.modal-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 14px; padding: 16px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }

/* ---------------- Wachbuch-Detail (kompakte Key/Value-Liste) ---------------- */
.wb-grid { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; align-items: baseline; }
.wb-grid .k { color: var(--text-muted); font-size: .78rem; }
.wb-grid .v { font-size: .9rem; }

/* ---------------- Wachbuch (Abschluss-Statistik) ---------------- */
.wb-stats { display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 14px; align-items: center; }
.wb-stat { display: flex; align-items: flex-start; gap: 10px; }
.wb-stat .dot { width: 12px; height: 12px; border-radius: 50%; margin-top: 5px; flex: 0 0 auto; }
.wb-stat .dot.teal { background: #3fb6c4; }
.wb-stat .dot.green { background: #4fc777; }
.wb-stat .dot.red { background: #d8473f; }
.wb-stat .v { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.wb-stat .l { color: var(--text-muted); font-size: .78rem; margin-top: 3px; }
.wb-circle { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.3rem; color: #fff; justify-self: end; }
.wb-circle.ok { background: #4fc777; }
.wb-circle.warn { background: #d6a032; }
.wb-circle.bad { background: #d8473f; }
.wb-missed td { opacity: .7; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .85rem; }

/* ---------------- Token-Auswahl (Objekte zuweisen) ---------------- */
.token-select { position: relative; border: 1px solid var(--border-light); border-radius: 10px; background: var(--surface-2); padding: 6px; }
.token-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.token-chips:empty { display: none; }
.token-chip { display: inline-flex; align-items: center; gap: 4px; background: var(--surface-3); border: 1px solid var(--border-light); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: .85rem; }
.token-chip small { font-size: .72rem; }
.token-x { background: transparent; border: none; color: var(--text-muted); font-size: 1.15rem; line-height: 1; cursor: pointer; padding: 0 4px; }
.token-x:hover { color: var(--primary-400); }
.token-input { width: 100%; border: none; background: transparent; color: var(--text); padding: 8px 6px; outline: none; font-size: .95rem; }
.token-drop { position: absolute; left: 0; right: 0; top: 100%; margin-top: 4px; z-index: 30; background: var(--surface); border: 1px solid var(--border-light); border-radius: 10px; box-shadow: 0 12px 30px rgba(0,0,0,.5); max-height: 260px; overflow-y: auto; }
.token-opt { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid var(--border); }
.token-opt:last-child { border-bottom: none; }
.token-opt:hover { background: var(--surface-2); }
.token-empty { padding: 10px 12px; color: var(--text-muted); }
.avail-ok { color: #8fe3ac !important; font-weight: 600; }
.avail-bad { color: #f3b4af !important; font-weight: 600; }

/* ---------------- Rundgang-Durchführung (Run) ---------------- */
.run-main { max-width: 640px; margin: 0 auto; padding: 0 0 96px; }
.run-top { position: sticky; top: 0; z-index: 50; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 12px; }
.run-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.run-title { display: flex; flex-direction: column; line-height: 1.2; margin-right: auto; min-width: 0; }
.run-title strong { font-size: 1rem; }
.run-title small { color: var(--text-muted); font-size: .78rem; }
.run-net { font-size: .72rem; font-weight: 700; white-space: nowrap; }
.run-net.on { color: #4fc777; }
.run-net.off { color: var(--red); }
.run-stat { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; font-weight: 700; font-size: .92rem; }
.run-pending { color: var(--amber); font-weight: 600; font-size: .8rem; }
.run-actions { padding: 12px; }
.run-actions .btn { width: 100%; }

/* Last-Scan-Banner: prominent unter dem Fortschritt fuer 7 Sek nach jedem
   Scan. Slidet sanft rein/raus, blockiert nichts. Bei Duplikat-Scans wird
   die Klasse "is-dup" gesetzt (Amber-Akzent statt Gruen). */
.run-last { display: flex; align-items: center; gap: 12px; margin: 8px 12px 0;
    padding: 12px 14px; border-radius: 12px;
    background: linear-gradient(135deg, rgba(16,185,129,.18), rgba(16,185,129,.08));
    border: 1px solid rgba(16,185,129,.45);
    animation: gdRunLastIn .2s ease-out;
    box-shadow: 0 4px 14px rgba(16,185,129,.18);
}
.run-last[hidden] { display: none; }
.run-last.is-dup { background: linear-gradient(135deg, rgba(245,158,11,.20), rgba(245,158,11,.08));
    border-color: rgba(245,158,11,.55); box-shadow: 0 4px 14px rgba(245,158,11,.18); }
.run-last.is-out { animation: gdRunLastOut .25s ease-in forwards; }
.run-last-icon { font-size: 1.6rem; line-height: 1; flex-shrink: 0;
    width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: rgba(16,185,129,.25); color: #34d399; font-weight: 800;
}
.run-last.is-dup .run-last-icon { background: rgba(245,158,11,.22); color: #f59e0b; }
.run-last-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.run-last-label { font-size: 1.05rem; line-height: 1.15; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-last-sub { font-size: .82rem; color: var(--muted); }
.run-last-sub:empty { display: none; }
@keyframes gdRunLastIn  { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@keyframes gdRunLastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-4px); } }

.cp-list { padding: 0 12px; display: flex; flex-direction: column; gap: 8px; }
.cp-item { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.cp-row { display: flex; align-items: center; gap: 12px; padding: 14px; cursor: pointer; }
.cp-item .cp-check { width: 26px; height: 26px; flex: 0 0 auto; border-radius: 50%; border: 2px solid var(--border-light); display: flex; align-items: center; justify-content: center; font-weight: 800; color: transparent; }
.cp-item .cp-name { margin-right: auto; font-weight: 600; }
.cp-item .cp-flags { font-size: .95rem; white-space: nowrap; letter-spacing: 1px; }
.cp-item .cp-time { color: var(--text-muted); font-size: .82rem; white-space: nowrap; }
.cp-item.done { border-color: rgba(79,199,119,.45); }
.cp-item.done .cp-check { background: #4fc777; border-color: #4fc777; color: #07210f; }
.cp-item.done .cp-name { color: var(--text-muted); }
.cp-item.pending { border-color: rgba(214,160,50,.55); }
.cp-item.pending .cp-check { border-color: var(--amber); color: var(--amber); }

/* Anmerkung & Foto je Kontrollpunkt (Run-Panel) */
.gd-mini { width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px; border: 1px solid var(--border-light); background: var(--surface-2); color: var(--text); font-size: 1rem; line-height: 1; cursor: pointer; }
.cp-panel { padding: 0 14px 14px; border-top: 1px dashed var(--border); }
.cp-plabel { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); margin: 10px 0 6px; }
.cp-note-input { width: 100%; border-radius: 10px; border: 1px solid var(--border-light); background: var(--surface-2); color: var(--text); padding: 9px 11px; font-family: inherit; font-size: .92rem; -webkit-appearance: none; appearance: none; }
.cp-note-input:focus { outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-glow); }
.cp-photo-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-photo-thumb { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border-light); cursor: pointer; }
.cp-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.cp-progress[hidden] { display: none; }
.cp-progress-track { flex: 1 1 auto; height: 6px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.cp-progress-bar { height: 100%; width: 0; background: var(--primary-500); transition: width .15s ease; }
.cp-progress-pct { font-size: .75rem; color: var(--text-muted); white-space: nowrap; }
.cp-lb { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,.85); display: flex; align-items: center; justify-content: center; padding: 20px; }
.cp-lb[hidden] { display: none; }
.cp-lb-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; max-width: 100%; max-height: 100%; }
.cp-lb-img { max-width: 92vw; max-height: 78vh; border-radius: 10px; }
.cp-lb-x { position: absolute; top: 14px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: none; background: rgba(255,255,255,.16); color: #fff; font-size: 1.2rem; cursor: pointer; }

/* Foto-Anzeige im Wachbuch-Detail (read-only) */
.wb-photos { display: flex; flex-wrap: wrap; gap: 6px; }
.wb-photo-thumb { width: 54px; height: 54px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border-light); cursor: pointer; }

/* Lade-Overlay (z. B. Rundgang-Start) */
.start-overlay { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.72); }
.start-overlay[hidden] { display: none; }
.start-overlay-box { display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--border-light); border-radius: 12px; padding: 16px 20px; color: var(--text); font-weight: 600; }
.gd-spinner { width: 22px; height: 22px; flex: 0 0 auto; border-radius: 50%; border: 3px solid var(--border-light); border-top-color: var(--primary-500); animation: gd-spin .7s linear infinite; }
@keyframes gd-spin { to { transform: rotate(360deg); } }

/* Laufende Rundgänge (Mitarbeiter-Home) */
.running-card { margin-bottom: 12px; }
.running-list { display: flex; flex-direction: column; gap: 8px; }
.running-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); text-decoration: none; color: var(--text); }
.running-item:hover { border-color: var(--primary-500); }
.running-main { display: flex; flex-direction: column; gap: 2px; margin-right: auto; min-width: 0; }
.running-main small { color: var(--text-muted); font-size: .8rem; }
.running-stat { font-weight: 700; color: var(--text-muted); font-size: .9rem; white-space: nowrap; }
.badge.primary { background: rgba(192, 20, 48, .18); color: #f4b3bf; border-color: rgba(192, 20, 48, .5); }

/* NFC-Status-Banner (Mitarbeiter-Home – Frei-Scan) */
.nfc-status { position: sticky; top: 0; z-index: 90; margin: 0 0 10px; padding: 8px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border-light); color: var(--text); font-size: .88rem; }
.nfc-status[hidden] { display: none; }

/* Tabs (z. B. Kunden-Detailseite) */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; flex-wrap: wrap; overflow-x: auto; }
.tab-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 16px; color: var(--text-muted); text-decoration: none; border: none; border-bottom: 2px solid transparent; background: transparent; font-weight: 600; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.tab-link:hover { color: var(--text); }
.tab-link.active { color: var(--text); border-bottom-color: var(--primary-500); }
.tab-link svg { color: inherit; }
.tab-count { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-muted); font-size: .76rem; font-weight: 700; }
.tab-link.active .tab-count { background: rgba(192, 20, 48, .18); color: #f4b3bf; }
/* Wachbuch-Tab: rote Akzent-Pille — sticht zwischen den Standard-Tabs heraus,
   damit Admin/Superadmin direkt sieht, wo das Wachbuch sitzt. */
.tab-link.tab-link-accent {
    color: #fff; background: var(--primary-600, #dc2626);
    border-radius: 8px; padding: 8px 14px; margin: 2px 0 6px 8px;
    border-bottom: 0; box-shadow: 0 4px 12px rgba(220, 38, 38, .25);
}
.tab-link.tab-link-accent:hover { background: var(--primary-700, #b91c1c); color: #fff; }
.tab-link.tab-link-accent svg { color: #fff; }
.tab-count.tab-count-accent {
    background: rgba(255, 255, 255, .22); color: #fff;
}
.tab-panel[hidden] { display: none; }

/* Bundesländer-Chips (Admin-Formular) */
.state-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.state-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--border-light); border-radius: 999px; background: var(--surface-2); cursor: pointer; user-select: none; font-size: .9rem; color: var(--text); }
.state-chip.on { border-color: var(--primary-500); background: rgba(192, 20, 48, .14); }
.state-chip input { appearance: none; -webkit-appearance: none; width: 0; height: 0; margin: 0; }

/* Unbekannte Datenträger im Lauf (werden erfasst, gehören nicht zum Rundgang) */
.unknown-card { margin: 0 12px 12px; }
.unknown-card[hidden] { display: none; }
.cp-extra-list { display: flex; flex-direction: column; gap: 6px; }
.cp-extra { display: flex; flex-direction: column; gap: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.cp-extra-head { display: flex; align-items: center; gap: 10px; }
.cp-extra-label { margin-right: auto; font-weight: 600; font-size: .9rem; }
.cp-extra-time { white-space: nowrap; color: var(--text-muted); font-size: .85rem; }
.cp-extra.pending .cp-extra-time { color: var(--amber); }
.cp-extra.pending .cp-extra-time::after { content: " · offline"; }
.cp-extra-panel[hidden] { display: none; }
.run-foot { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--border); }

/* ---------------- NFC-Schnellerfassung ---------------- */
#nfcTable input[type="text"] { width: 100%; }
#nfcTable .nfc-nr { color: var(--text-muted); }
@keyframes nfcFlash { from { background: rgba(79,199,119,.30); } to { background: transparent; } }
.nfc-flash { animation: nfcFlash .7s ease; }

/* ---------------- App-Installation (PWA) ---------------- */
.pwa-card { text-align: center; }
.pwa-qr { display: inline-block; background: #fff; padding: 12px; border-radius: 12px; margin: 8px auto; }
.pwa-qr img { display: block; width: 240px; height: 240px; }
.pwa-diag { list-style: none; margin: 0; padding: 0; }
.pwa-diag li { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.pwa-diag li::before { width: 18px; text-align: center; flex: 0 0 auto; font-weight: 800; }
.pwa-diag li.ok { color: #8fe3ac; }
.pwa-diag li.ok::before { content: "\2713"; color: #4fc777; }
.pwa-diag li.bad { color: #f3b4af; }
.pwa-diag li.bad::before { content: "\2717"; color: #d8473f; }
.pwa-diag li.wait { color: var(--text-muted); }
.pwa-diag li.wait::before { content: "\2026"; color: var(--text-muted); }

/* ---------------- Install-Banner (fährt von unten herein) ---------------- */
.gd-install-banner {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 1200;
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border-light);
  border-radius: 14px; padding: 11px 13px; box-shadow: 0 12px 34px rgba(0,0,0,.55);
  transform: translateY(160%); transition: transform .35s ease;
  padding-bottom: calc(11px + env(safe-area-inset-bottom, 0px));
}
.gd-install-banner.show { transform: translateY(0); }
.gd-install-banner .gd-ib-icon { width: 42px; height: 42px; border-radius: 10px; flex: 0 0 auto; }
.gd-ib-text { display: flex; flex-direction: column; line-height: 1.25; margin-right: auto; min-width: 0; }
.gd-ib-text strong { font-size: .95rem; }
.gd-ib-text span { font-size: .78rem; color: var(--text-muted); }
.gd-ib-btn { flex: 0 0 auto; background: linear-gradient(135deg, var(--primary), var(--primary-700));
  color: #fff; border: none; border-radius: 9px; padding: 9px 15px; font-weight: 700; cursor: pointer; }
.gd-ib-close { flex: 0 0 auto; background: transparent; border: none; color: var(--text-muted);
  font-size: 1.5rem; line-height: 1; cursor: pointer; padding: 0 4px; }
@media (min-width: 760px) { .gd-install-banner { left: auto; right: 16px; bottom: 16px; max-width: 380px; } }

/* ---------------- Tabellen als Karten auf dem Handy ---------------- */
@media (max-width: 640px) {
  .table-wrap { border: 0; background: transparent; overflow: visible; }

  table.table.table-cards thead { display: none; }
  table.table.table-cards,
  table.table.table-cards tbody { display: block; width: 100%; }
  table.table.table-cards tr {
    display: block; background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; padding: 8px 12px; margin-bottom: 10px;
  }
  table.table.table-cards tr:hover { background: var(--surface); }
  table.table.table-cards td {
    display: flex; gap: 12px; justify-content: space-between; align-items: baseline;
    border: 0; padding: 5px 0; text-align: right; white-space: normal;
  }
  table.table.table-cards td[data-label]::before {
    content: attr(data-label); flex: 0 0 40%; text-align: left;
    color: var(--text-muted); font-size: .74rem; font-weight: 600; letter-spacing: 0;
    text-transform: none;
  }
  /* Zellen ohne Überschrift (Aktionen, Prio-Punkt): kein leeres Label */
  table.table.table-cards td:not([data-label]) { justify-content: flex-end; }
  table.table.table-cards td .row-actions { justify-content: flex-end; }

  /* Key/Value-Detailtabellen (ohne thead): feste Spaltenbreiten lösen */
  table.table th { width: auto !important; }
}
@media print {
  .topbar, .sidebar, .nav-overlay, .no-print, [data-pwa-install] { display: none !important; }
  .shell, .main, .grid.cols-2 { display: block !important; padding: 0 !important; }
  body, .card { background: #fff !important; color: #111 !important; border: none !important; box-shadow: none !important; }
  .muted, .input-hint { color: #333 !important; }
}
@media (max-width: 640px) {
  .wb-stats { grid-template-columns: 1fr 1fr; }
  .wb-circle { grid-column: span 2; justify-self: center; }
}

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 16px; border-radius: 11px; border: 1px solid var(--border-light);
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: .92rem;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.btn:hover { border-color: var(--primary-700); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-700)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px var(--primary-glow); }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: .82rem; border-radius: 9px; }
.btn-block { width: 100%; }

/* ---------------- Forms ---------------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: .85rem; color: var(--silver); margin-bottom: 6px; }
.form-group input:not([type=checkbox]):not([type=radio]), .form-group select, .form-group textarea {
  width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--border-light);
  background: var(--surface-2); color: var(--text); font-size: .95rem; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
.form-group input:not([type=checkbox]):not([type=radio]):focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-glow);
}
/* Checkboxen/Radios nativ lassen (sonst unsichtbar/nicht klickbar) + Markenfarbe */
.form-group input[type=checkbox], .form-group input[type=radio],
input[type=checkbox], input[type=radio] {
  width: 18px; height: 18px; accent-color: var(--primary); cursor: pointer; flex: 0 0 auto;
  -webkit-appearance: auto; appearance: auto;
}
/* Autofill (Passwortmanager) nicht weiß einfärben */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
  box-shadow: 0 0 0 1000px var(--surface-2) inset;
  caret-color: var(--text);
  transition: background-color 9999s ease-in-out 0s;
}
.form-group textarea { min-height: 96px; resize: vertical; }
.input-hint { color: var(--text-dim); font-size: .78rem; margin-top: 5px; }

/* ---------------- Alerts / Badges ---------------- */
.alert { border-radius: 11px; padding: 11px 14px; margin-bottom: 12px; border: 1px solid var(--border-light); font-size: .9rem; }
.alert.success { background: rgba(47,170,90,.12); border-color: rgba(47,170,90,.5); color: #b6f0c9; }
.alert.error   { background: rgba(216,71,63,.12); border-color: rgba(216,71,63,.5); color: #f6c3bf; }
.alert.info    { background: rgba(214,160,50,.12); border-color: rgba(214,160,50,.5); color: #f3dfb0; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px;
  font-size: .74rem; font-weight: 700; background: var(--surface-3); color: var(--silver); border: 1px solid var(--border-light);
}

/* ---------------- Auth ---------------- */
.auth-body { background: radial-gradient(1200px 600px at 50% -10%, rgba(192,20,48,.16), transparent), var(--bg); min-height: 100vh; }
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.auth-card { width: 100%; max-width: 380px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px 24px; }
.auth-logo {
  width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 16px; object-fit: contain; display: block;
  box-shadow: 0 10px 30px var(--primary-glow);
}
.auth-card h1 { text-align: center; font-size: 1.4rem; }
.auth-card .tagline { text-align: center; color: var(--text-muted); font-size: .82rem; margin: 4px 0 20px; }
.auth-form { margin-top: 6px; }

/* ---------------- Responsive (Desktop) ---------------- */
@media (min-width: 900px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
  .main { padding-bottom: 30px; }
  .bottom-nav { display: none; }
}

/* ================= Verwaltungs-Shell (Desktop-first) ================= */
.shell { display: flex; align-items: stretch; min-height: calc(100vh - var(--topbar-h)); }
.app-shell .main { max-width: none; margin: 0; flex: 1; min-width: 0; padding: 22px 26px 40px; }
.sidebar {
  width: 240px; flex: 0 0 240px; background: var(--surface);
  border-right: 1px solid var(--border); padding: 14px 10px;
}
.side-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: calc(var(--topbar-h) + 14px); }
.side-nav .nav-item {
  display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px;
  color: var(--text-muted); font-weight: 600; font-size: .92rem;
}
.side-nav .nav-item .ico { display: inline-flex; color: var(--text-dim); }
.side-nav .nav-item:hover { background: var(--surface-2); color: var(--text); }
.side-nav .nav-item.active { background: linear-gradient(135deg, rgba(192,20,48,.20), rgba(192,20,48,.05)); color: #fff; }
.side-nav .nav-item.active .ico { color: var(--primary-400); }
.nav-toggle { display: none; }
.nav-overlay { display: none; }

@media (max-width: 899px) {
  .shell { display: block; }
  .nav-toggle { display: inline-grid; }
  .sidebar {
    position: fixed; top: var(--topbar-h); left: 0; bottom: 0; z-index: 50; width: 250px;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .nav-overlay.show { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; background: rgba(0,0,0,.55); z-index: 49; }
}

/* ================= Tabellen / Listen ================= */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar h1 { margin-right: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.table th, table.table td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.table th { color: var(--text-muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .5px; background: var(--surface-2); }
table.table tbody tr:last-child td { border-bottom: none; }
table.table tbody tr:hover { background: var(--surface-2); }
table.table td .row-actions { display: flex; gap: 6px; justify-content: flex-end; }
.empty-state { text-align: center; color: var(--text-muted); padding: 34px 16px; }
.empty-state .ico { display: block; color: var(--text-dim); margin-bottom: 8px; }

/* ================= Utilities ================= */
.flex { display: flex; }
.flex.gap { gap: 10px; }
.wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.items-end { align-items: flex-end; }
.between { justify-content: space-between; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.grid { display: grid; gap: 12px; }
.grid.cols-2 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid.cols-2 { grid-template-columns: 1fr 1fr; } }
.text-right { text-align: right; }
.danger { color: var(--red); }

/* Badge-Varianten */
.badge.green { background: rgba(47,170,90,.16); color: #8fe3ac; border-color: rgba(47,170,90,.4); }
.badge.amber { background: rgba(214,160,50,.16); color: #f0d79b; border-color: rgba(214,160,50,.4); }
.badge.red   { background: rgba(216,71,63,.16); color: #f3b4af; border-color: rgba(216,71,63,.4); }
.badge.gray  { background: var(--surface-3); color: var(--text-muted); }
.badge.blue  { background: rgba(70,120,210,.16); color: #b3c9f2; border-color: rgba(70,120,210,.4); }
.badge.orange{ background: rgba(230,126,34,.18); color: #f2b07a; border-color: rgba(230,126,34,.45); }
.wb-legend { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: .76rem; color: var(--text-muted); align-items: center; }
.wb-legend span { display: inline-flex; align-items: center; gap: 5px; }
.badge.dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; }

/* Wachbuch-Filter */
.wb-filter { margin-bottom: 16px; padding: 14px; }
.filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.filter-field { display: flex; flex-direction: column; gap: 6px; }
.filter-field > span { font-size: .72rem; text-transform: uppercase; letter-spacing: .4px; color: var(--text-muted); }
.filter-field input, .filter-field select {
  width: 100%; padding: 10px 11px; border-radius: 10px; border: 1px solid var(--border-light);
  background: var(--surface-2); color: var(--text); font-size: .92rem; font-family: inherit;
  -webkit-appearance: none; appearance: none;
}
.filter-field input:focus, .filter-field select:focus {
  outline: none; border-color: var(--primary-500); box-shadow: 0 0 0 3px var(--primary-glow);
}
.filter-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.filter-actions .spacer { flex: 1 1 auto; }
@media (max-width: 640px) {
  .filter-actions .wb-legend { width: 100%; }
}

/* Wachbuch-Export (Download im Wachbuch) */
.wb-export { margin-bottom: 16px; padding: 14px; }
.wb-export-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; color: var(--text); }
.wb-export-head svg { color: var(--primary-500); }

/* Aufklappbare Bereiche (Filter / Export) – spart Platz, Klick auf die Kopfzeile öffnet */
details.collapse { padding: 0; margin-bottom: 16px; }
details.collapse > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  padding: 14px; color: var(--text); user-select: none;
}
details.collapse > summary::-webkit-details-marker { display: none; }
details.collapse > summary svg { color: var(--primary-500); }
details.collapse > summary::after {
  content: ""; margin-left: auto; flex: 0 0 auto; width: 9px; height: 9px;
  border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
details.collapse[open] > summary::after { transform: rotate(-135deg); }
details.collapse .collapse-body { padding: 0 14px 14px; }

/* Pagination */
.pagination { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.pagination a, .pagination span {
  padding: 6px 11px; border-radius: 8px; border: 1px solid var(--border-light);
  background: var(--surface-2); color: var(--text); font-size: .85rem;
}
.pagination .current { background: var(--primary-700); border-color: transparent; color: #fff; }
.pagination .disabled { opacity: .4; }

/* Such-/Filterfeld */
.search-box { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border-light); border-radius: 10px; padding: 8px 12px; min-width: 240px; }
.search-box input { border: none; background: transparent; color: var(--text); width: 100%; font-size: .92rem; outline: none; }
.search-box .ico { color: var(--text-dim); }


/* =========================================================================
   Download-Center v2 — professionelles UI
   ========================================================================= */

.page-head { display:flex; align-items:flex-end; justify-content:space-between; margin: 4px 0 18px; gap:16px; flex-wrap:wrap; }
.page-head h1 { margin:0; font-size:1.4rem; display:inline-flex; align-items:center; gap:10px; }
.page-head .page-sub { margin:4px 0 0; color: var(--text-dim); font-size:.92rem; }

/* ----- Banner ------------------------------------------------------------ */
.dl-banner {
    display:flex; gap:14px; align-items:flex-start; padding:14px 18px; margin: 0 0 18px;
    background: linear-gradient(180deg, rgba(255, 196, 0, .08), rgba(255, 196, 0, .03));
    border:1px solid rgba(255, 196, 0, .25); border-left:3px solid #ffc400;
    border-radius:12px; color: var(--text);
}
.dl-banner-ico { color:#ffc400; flex:0 0 auto; padding-top:1px; }
.dl-banner em { color: var(--text); font-style: normal; }

/* ----- Tabs ------------------------------------------------------------- */
.dl-tabs {
    display:flex; gap:4px; margin: 0 0 18px;
    background: var(--surface-2); padding:4px; border-radius:12px;
    border:1px solid var(--border-light); width:fit-content; max-width:100%;
}
.dl-tab {
    display:inline-flex; align-items:center; gap:8px; padding:9px 16px;
    color: var(--text-dim); text-decoration:none; font-weight:500; font-size:.92rem;
    border-radius:9px; transition: background .15s, color .15s; white-space:nowrap;
}
.dl-tab:hover { color: var(--text); background: rgba(255,255,255,.04); }
.dl-tab.is-active {
    background: var(--surface); color: var(--text);
    box-shadow: 0 1px 0 rgba(0,0,0,.4), 0 0 0 1px var(--border-light);
}
.dl-tab-count {
    margin-left:4px; font-size:.74rem; background: var(--primary); color:#fff;
    padding: 1px 7px; border-radius:10px; line-height:1.4;
}

/* ----- Card ------------------------------------------------------------- */
.dl-card {
    background: var(--surface); border:1px solid var(--border-light);
    border-radius:14px; padding:0; margin: 0 0 18px; overflow: visible;
}
.dl-card-head {
    display:flex; align-items:center; justify-content:space-between; gap:14px;
    padding: 14px 20px; border-bottom:1px solid var(--border-light); flex-wrap:wrap;
}
.dl-card-head h2 {
    margin:0; font-size:1.02rem; font-weight:600;
    display:inline-flex; align-items:center; gap:10px;
}
.dl-hint { color: var(--text-dim); font-size:.84rem; }
.dl-card-foot {
    display:flex; gap:10px; padding:14px 20px;
    border-top:1px solid var(--border-light); align-items:center; flex-wrap:wrap;
}

/* ----- Form-Grid ------------------------------------------------------- */
.dl-grid {
    display:grid; gap:14px; padding:18px 20px;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.dl-field { display:flex; flex-direction:column; gap:6px; min-width:0; }
.dl-field--wide { grid-column: 1 / -1; }
.dl-field-label { font-size:.78rem; color: var(--text-dim); font-weight:500; letter-spacing:.02em; }
.dl-input {
    background: var(--surface-2); color: var(--text); border:1px solid var(--border-light);
    border-radius:10px; padding: 10px 12px; font-size:.94rem; outline:none;
    transition: border-color .15s, box-shadow .15s;
}
.dl-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(192, 20, 48, .18); }
.dl-input[type="date"] { color-scheme: dark; }

/* ----- gd-combo (Suchbare Combobox) ------------------------------------- */
.gd-combo { position: relative; width:100%; }
.gd-combo-field {
    position: relative;
    background: var(--surface-2); border:1px solid var(--border-light);
    border-radius:10px; display:flex; align-items:center;
    transition: border-color .15s, box-shadow .15s;
}
.gd-combo.is-open .gd-combo-field,
.gd-combo-field:focus-within {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(192, 20, 48, .18);
}
.gd-combo-input {
    flex:1; background:transparent; border:none; outline:none; color: var(--text);
    padding: 10px 36px 10px 12px; font-size:.94rem; min-width:0;
}
.gd-combo-input::placeholder { color: var(--text-dim); }
.gd-combo-caret {
    position:absolute; right:12px; top:50%; transform: translateY(-50%);
    color: var(--text-dim); pointer-events:none; font-size:.8rem;
    transition: transform .15s, color .15s;
}
.gd-combo.is-open .gd-combo-caret { transform: translateY(-50%) rotate(180deg); color: var(--primary); }
.gd-combo-clear {
    position:absolute; right:30px; top:50%; transform: translateY(-50%);
    background: rgba(255,255,255,.06); border:none; color: var(--text-dim);
    width:20px; height:20px; border-radius:50%; cursor:pointer; font-size:14px; line-height:1;
    display:none; align-items:center; justify-content:center; padding:0;
}
.gd-combo[data-selected]:not([data-selected="0"]):not([data-selected=""]) .gd-combo-clear { display:flex; }
.gd-combo-clear:hover { background: var(--primary); color:#fff; }

.gd-combo-list {
    position:absolute; left:0; right:0; top: calc(100% + 4px); z-index: 20;
    background: var(--surface); border:1px solid var(--border-light);
    border-radius:10px; box-shadow: 0 10px 30px rgba(0,0,0,.55);
    max-height: 280px; overflow-y:auto; padding:4px;
}
.gd-combo-item {
    display:flex; flex-direction:column; gap:1px; padding: 8px 12px;
    border-radius:8px; cursor:pointer; line-height:1.3;
}
.gd-combo-item.is-focus  { background: rgba(192, 20, 48, .18); }
.gd-combo-item.is-selected { background: rgba(220, 38, 38, .22); }
.gd-combo-item-main { color: var(--text); font-size:.92rem; }
.gd-combo-item-sub  { color: var(--text-dim); font-size:.78rem; }
.gd-combo-empty {
    padding: 14px; text-align:center; color: var(--text-dim); font-size:.88rem;
}

/* ----- Tabellen --------------------------------------------------------- */
.dl-table-wrap { overflow-x:auto; }
.dl-table { width:100%; border-collapse: collapse; font-size:.92rem; }
.dl-table thead th {
    text-align:left; padding: 10px 16px; color: var(--text-dim);
    font-weight:500; font-size:.78rem; letter-spacing:.04em; text-transform: uppercase;
    border-bottom:1px solid var(--border-light); background: var(--surface-2);
}
.dl-table tbody td {
    padding: 12px 16px; border-bottom:1px solid var(--border-light); color: var(--text);
}
.dl-table tbody tr:last-child td { border-bottom: none; }
.dl-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.dl-table .r { text-align:right; }
.dl-table .nowrap { white-space:nowrap; }
.dl-table .muted { color: var(--text-dim); }
.dl-link { color: var(--primary); text-decoration:none; font-weight:500; }
.dl-link:hover { text-decoration:underline; }
.dl-empty { padding: 28px 20px; text-align:center; color: var(--text-dim); }

/* ----- Badges ----------------------------------------------------------- */
.badge-ok     { background: rgba( 60, 200, 120, .18); color:#5edb95; border:1px solid rgba(60,200,120,.3); }
.badge-warn   { background: rgba(255, 196,   0, .18); color:#ffd35a; border:1px solid rgba(255,196,0,.3); }
.badge-info   { background: rgba( 80, 160, 255, .18); color:#7ec0ff; border:1px solid rgba(80,160,255,.3); }
.badge-danger { background: rgba(220,  60,  60, .20); color:#ff7e7e; border:1px solid rgba(220,60,60,.3); }
.badge-ok, .badge-warn, .badge-info, .badge-danger {
    display:inline-block; padding: 3px 9px; border-radius:999px;
    font-size:.74rem; font-weight:500; letter-spacing:.02em;
}

/* ----- Buttons (Erweiterung) ------------------------------------------- */
.btn { display:inline-flex; align-items:center; gap:8px; padding: 10px 16px;
    border-radius:10px; border:1px solid var(--border-light); cursor:pointer;
    font-size:.92rem; font-weight:500; text-decoration:none; line-height:1;
    transition: background .15s, border-color .15s, transform .05s; background: var(--surface-2);
    color: var(--text);
}
.btn:hover  { background: rgba(255,255,255,.06); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color:#fff; }
.btn-primary:hover { background: #c41e1e; border-color:#c41e1e; }
.btn-ghost { background: transparent; }
.btn-icon { padding: 6px 10px; }
.btn-sm   { padding: 6px 12px; font-size:.84rem; }

/* ----- Dialog ----------------------------------------------------------- */
.dl-dialog {
    background: var(--surface); border:1px solid var(--border-light);
    border-radius:14px; color: var(--text); padding:24px;
    max-width: 480px; width: calc(100% - 32px);
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
}
.dl-dialog::backdrop { background: rgba(0,0,0,.6); backdrop-filter: blur(2px); }
.dl-dialog h3 { margin: 0 0 4px; font-size: 1.05rem; }
.dl-dialog .dl-field { margin: 16px 0; }
.dl-dialog-foot { display:flex; gap:10px; justify-content:flex-end; margin-top:6px; }

.small { font-size:.82rem; }
.muted { color: var(--text-dim); }

/* ----- Mobile-Polish ---------------------------------------------------- */
@media (max-width: 720px) {
    .dl-tabs { width: 100%; }
    .dl-tab  { flex:1; justify-content:center; padding: 9px 8px; }
    .dl-tab span { display:none; }
    .dl-tab svg { width:18px; height:18px; }
    .dl-grid { grid-template-columns: 1fr; gap:12px; padding:14px; }
    .dl-card-head, .dl-card-foot { padding: 12px 14px; }
    .dl-table thead { display:none; }
    .dl-table tbody tr { display:block; padding: 12px 14px; border-bottom:1px solid var(--border-light); }
    .dl-table tbody td { display:flex; justify-content:space-between; padding: 4px 0; border:none; gap:12px; }
    .dl-table tbody td.r { text-align:left; }
    .dl-table tbody td::before {
        content: attr(data-label); color: var(--text-dim);
        font-size:.78rem; text-transform:uppercase; letter-spacing:.04em;
    }
}

/* Mitarbeiter-Liste: klickbarer Name */
.mt-name-link { color: inherit; text-decoration: none; }
.mt-name-link:hover { color: var(--primary); }
.mt-name-link:hover strong { text-decoration: underline; }
