/* Blumtritt BauDoku – angelehnt an das Website-Designsystem (DESIGN.md) */
:root {
  --yellow: #F5C300;
  --yellow-h: #FFD700;
  --yellow-d: #C49B00;
  --purple: #7B2D8B;
  --purple-l: #9B3DAF;
  --dark: #111111;
  --dark2: #1A1A1A;
  --dark3: #242424;
  --mid: #2E2E2E;
  --border: #333333;
  --text: #F0F0F0;
  --muted: #999999;
  --white: #FFFFFF;
  --danger: #E5484D;
  --ok: #3DD68C;
  --font-head: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --font-body: 'Barlow', system-ui, sans-serif;
  --radius: 4px;
  --t: 180ms ease;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--dark); color: var(--text);
  font-family: var(--font-body); font-size: 16px; line-height: 1.5;
  min-height: 100dvh; overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* ---------- Kopfzeile & Menü ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 8px; padding: 0 12px 0 16px;
  background: rgba(17,17,17,0.94); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.brand {
  font-family: var(--font-head); font-weight: 900; font-size: 22px;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--white); white-space: nowrap;
}
.brand span { color: var(--yellow); }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--radius);
}
.icon-btn:hover { background: var(--dark3); }
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#backBtn { margin-left: -8px; }

.sync-pill {
  font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 10px; border-radius: var(--radius); background: var(--dark3); color: var(--yellow); border: 1px solid var(--border);
}
.sync-pill.offline { color: var(--muted); }
.sync-pill.error { color: var(--danger); border-color: var(--danger); }

.menu {
  position: fixed; top: var(--top-h); right: 8px; z-index: 40; min-width: 240px;
  background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; padding: 6px; box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}
.menu a, .menu button { padding: 12px 14px; border-radius: var(--radius); text-align: left; }
.menu a:hover, .menu button:hover { background: var(--dark3); color: var(--yellow); }
.menu-user { padding: 10px 14px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; color: var(--muted); font-size: 14px; }
.menu-user strong { display: block; color: var(--white); font-size: 16px; }

/* ---------- Layout ---------- */
.view { max-width: 1400px; margin: 0 auto; padding: 20px 16px calc(120px + var(--safe-b)); }
.view.narrow { max-width: 760px; }

.eyebrow {
  font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--yellow); display: block; margin-bottom: 6px;
}
h1, h2, h3 { font-family: var(--font-head); color: var(--white); line-height: 1.05; }
h1 { font-size: clamp(30px, 6vw, 44px); font-weight: 900; text-transform: uppercase; }
h1 em, h2 em { font-style: normal; color: var(--yellow); }
h2 { font-size: 24px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.02em; }
h3 { font-size: 19px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 20px; margin-bottom: 20px; }
.page-head .actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 18px; border-radius: var(--radius); border: 1px solid transparent;
  font-family: var(--font-head); font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  transition: background var(--t), border-color var(--t), color var(--t); white-space: nowrap;
}
.btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--yellow); color: var(--dark); }
.btn-primary:hover { background: var(--yellow-h); }
.btn-secondary { border-color: var(--border); color: var(--white); }
.btn-secondary:hover { border-color: var(--yellow); color: var(--yellow); }
.btn-ghost { background: rgba(123,45,139,0.14); color: var(--purple-l); border-color: rgba(123,45,139,0.35); }
.btn-ghost:hover { background: rgba(123,45,139,0.25); }
.btn-danger { color: var(--danger); border-color: rgba(229,72,77,0.4); }
.btn-danger:hover { background: rgba(229,72,77,0.12); }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 17px; }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ---------- Formulare ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label {
  font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
}
input[type=text], input[type=email], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 46px; padding: 12px 14px; border-radius: var(--radius);
  background: var(--dark3); color: var(--text); border: 1px solid var(--border);
  font: inherit; font-size: 16px; transition: border-color var(--t);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--yellow); }
input[type=date] { color-scheme: dark; }
.grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 1fr; } }
.form-error { color: var(--danger); margin: -4px 0 14px; font-size: 15px; }
.checkbox { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.checkbox input { width: 20px; height: 20px; accent-color: var(--yellow); }

.panel { background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 16px; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; position: relative; overflow: hidden; }
.login-wrap::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(245,195,0,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(245,195,0,0.05) 1px, transparent 1px);
  background-size: 80px 80px;
}
.login-card { position: relative; width: 100%; max-width: 400px; }
.login-card .brand { display: block; font-size: 30px; margin-bottom: 4px; }
.login-card .lead { color: var(--muted); margin-bottom: 28px; }

/* ---------- Dashboard ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; margin-bottom: 28px; }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--dark2); padding: 20px; }
.stat .num { font-family: var(--font-head); font-size: 44px; font-weight: 900; color: var(--white); line-height: 1; margin-top: 8px; }
.stat:first-child .num { color: var(--yellow); }

.recent { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px; }
.recent a { position: relative; background: var(--dark3); aspect-ratio: 4/3; overflow: hidden; }
.recent img { width: 100%; height: 100%; object-fit: cover; }
.recent .cap {
  position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; font-size: 12px; line-height: 1.3;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

/* ---------- Projektliste ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.toolbar .search { flex: 1 1 280px; position: relative; }
.toolbar .search input { padding-left: 42px; }
.toolbar .search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
.toolbar select { width: auto; min-width: 150px; }
.count { color: var(--muted); font-size: 14px; margin-left: auto; }

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th {
  position: sticky; top: 0; background: var(--dark2); text-align: left; padding: 12px 10px;
  font-family: var(--font-head); font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted);
  border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none;
}
table.list th[data-sort] { cursor: pointer; }
table.list th[data-sort]:hover { color: var(--white); }
table.list th.sorted { color: var(--yellow); }
table.list th.sorted::after { content: ' ↓'; }
table.list th.sorted.asc::after { content: ' ↑'; }
table.list td { padding: 11px 10px; border-bottom: 1px solid var(--border); vertical-align: top; }
table.list tbody tr { cursor: pointer; transition: background var(--t); }
table.list tbody tr:hover { background: var(--dark2); }
table.list tbody tr:last-child td { border-bottom: 0; }
.nr { font-family: var(--font-head); font-weight: 700; font-size: 16px; color: var(--white); white-space: nowrap; }
.nr small { display: block; color: var(--muted); font-weight: 600; font-size: 12px; }
.nowrap { white-space: nowrap; }
.photo-count { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.photo-count svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; }
.photo-count.has { color: var(--yellow); }

.cards { display: none; }
.card {
  display: flex; gap: 12px; padding: 14px; background: var(--dark2); border-bottom: 2px solid var(--dark);
}
.card .thumb { width: 64px; height: 64px; flex: none; background: var(--dark3); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; color: var(--mid); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .thumb svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.card .body { min-width: 0; flex: 1; }
.card .title { font-weight: 600; color: var(--white); line-height: 1.3; }
.card .meta { color: var(--muted); font-size: 14px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card .top { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }

@media (max-width: 860px) {
  .table-wrap { display: none; }
  .cards { display: block; border-radius: var(--radius); overflow: hidden; }
}

.pager { display: flex; gap: 8px; justify-content: center; align-items: center; margin-top: 16px; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: var(--radius);
  font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  background: var(--dark3); color: var(--muted); border: 1px solid var(--border); white-space: nowrap;
}
.badge.aktiv { color: var(--yellow); border-color: rgba(245,195,0,0.35); }
.badge.geplant { color: var(--purple-l); border-color: rgba(155,61,175,0.4); }
.badge.pending { color: var(--yellow); background: rgba(17,17,17,0.85); border-color: var(--yellow); }

/* ---------- Projektdetail ---------- */
.detail-head { display: grid; gap: 20px; margin-bottom: 24px; }
@media (min-width: 900px) { .detail-head { grid-template-columns: 1fr 360px; align-items: start; } }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 15px; }
.facts dt { color: var(--muted); }
.facts dd { color: var(--text); overflow-wrap: anywhere; }
.facts a { color: var(--yellow); }
.desc { white-space: pre-wrap; margin-top: 14px; color: var(--text); }

.capture-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 25;
  padding: 12px 16px calc(12px + var(--safe-b)); background: linear-gradient(transparent, var(--dark) 30%);
  display: flex; gap: 8px; justify-content: center;
}
.capture-bar .btn-primary { flex: 1; max-width: 420px; }
@media (min-width: 900px) {
  .capture-bar { position: static; padding: 0; background: none; justify-content: flex-start; margin-bottom: 20px; }
  .capture-bar .btn-primary { flex: none; }
}

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  padding: 7px 12px; border-radius: var(--radius); border: 1px solid var(--border); font-size: 14px; color: var(--muted); min-height: 36px;
}
.chip.on { border-color: var(--yellow); color: var(--yellow); }

.day { margin-bottom: 22px; }
.day-title { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 2px; }
@media (min-width: 700px) { .gallery { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); } }
.tile { position: relative; aspect-ratio: 1; background: var(--dark3); overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms ease; }
.tile:hover img { transform: scale(1.04); }
.tile .badge { position: absolute; top: 6px; left: 6px; }
.tile .cap {
  position: absolute; inset: auto 0 0 0; padding: 20px 8px 6px; font-size: 12px; line-height: 1.25; color: var(--white);
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.empty { padding: 48px 20px; text-align: center; color: var(--muted); border: 1px dashed var(--border); border-radius: var(--radius); }
.empty h3 { margin-bottom: 6px; }

/* ---------- Sheet / Dialog ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,0.7); display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 700px) { .overlay { align-items: center; padding: 24px; } }
.sheet {
  width: 100%; max-width: 640px; max-height: 92dvh; overflow-y: auto;
  background: var(--dark2); border: 1px solid var(--border); border-radius: 10px 10px 0 0;
  padding: 20px 16px calc(20px + var(--safe-b));
}
@media (min-width: 700px) { .sheet { border-radius: var(--radius); padding: 24px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sheet-actions { display: flex; gap: 8px; margin-top: 8px; }
.sheet-actions .btn { flex: 1; }
.preview-strip { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 4px; }
.preview-strip img { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius); flex: none; }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; background: #000; display: flex; flex-direction: column; }
.lb-top { display: flex; align-items: center; gap: 8px; padding: 8px; }
.lb-top .count { margin: 0 auto 0 8px; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; position: relative; touch-action: pan-y; }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 48px; height: 72px; display: grid; place-items: center; background: rgba(0,0,0,0.4); }
.lb-nav svg { width: 28px; height: 28px; stroke: #fff; fill: none; stroke-width: 2; }
.lb-nav.prev { left: 0; }
.lb-nav.next { right: 0; }
.lb-info { padding: 14px 16px calc(14px + var(--safe-b)); background: var(--dark2); border-top: 1px solid var(--border); }
.lb-info h3 { margin-bottom: 4px; }
.lb-info .note { white-space: pre-wrap; margin-top: 6px; }
.lb-info .row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* ---------- Benutzer ---------- */
.users { display: grid; gap: 2px; }
.user-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--dark2); }
.user-row .avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--dark3); display: grid; place-items: center; flex: none;
  font-family: var(--font-head); font-weight: 800; color: var(--yellow);
}
.user-row.inactive { opacity: 0.5; }
.user-row .grow { flex: 1; min-width: 0; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(90px + var(--safe-b)); transform: translateX(-50%); z-index: 70;
  background: var(--white); color: var(--dark); padding: 12px 18px; border-radius: var(--radius); font-weight: 600;
  max-width: calc(100% - 32px); box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.error { background: var(--danger); color: var(--white); }

.spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--yellow); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 40px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* ---------- Bericht (Druck) ---------- */
.report { background: #fff; color: #111; max-width: 900px; margin: 0 auto; padding: 32px; font-size: 13px; }
.report h1, .report h2, .report h3 { color: #111; }
.report h1 { font-size: 30px; }
.report .r-head { display: flex; justify-content: space-between; gap: 20px; border-bottom: 3px solid var(--yellow); padding-bottom: 14px; margin-bottom: 18px; }
.report .r-brand { font-family: var(--font-head); font-weight: 900; font-size: 22px; text-transform: uppercase; letter-spacing: 0.05em; }
.report .facts dt { color: #666; }
.report .facts dd { color: #111; }
.report .r-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.report figure { break-inside: avoid; }
.report figure img { width: 100%; aspect-ratio: 4/3; object-fit: cover; border: 1px solid #ddd; }
.report figcaption { margin-top: 4px; line-height: 1.35; }
.report figcaption .muted { color: #666; }
.report-tools { display: flex; gap: 8px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.report .r-table { width: 100%; border-collapse: collapse; margin-top: 18px; }
.report .r-table th, .report .r-table td { border: 1px solid #ccc; padding: 6px 8px; text-align: left; vertical-align: top; color: #111; }
.report .r-table th { background: #f3f3f3; font-weight: 700; }
.report .r-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 64px; }
.report .r-sign div { border-top: 1px solid #111; padding-top: 6px; font-size: 12px; color: #444; }
body.printing { background: #fff; }
@media print {
  @page { margin: 14mm; }
  body { background: #fff !important; }
  .topbar, .menu, .report-tools, .toast, .tabbar { display: none !important; }
  .view { padding: 0; max-width: none; }
  .report { padding: 0; max-width: none; }
}

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 420px) { .hide-sm { display: none; } }

/* ---------- Navigation ---------- */
:root { --tab-h: 64px; }
.mainnav { display: none; gap: 2px; margin-left: 20px; }
.mainnav a {
  display: flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: var(--radius); color: var(--muted);
  font-family: var(--font-head); font-size: 14px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.mainnav a svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mainnav a:hover { color: var(--white); background: var(--dark3); }
.mainnav a.on { color: var(--yellow); }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(17,17,17,0.97); border-top: 1px solid var(--border); backdrop-filter: blur(8px);
}
.tabbar a {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted);
  font-family: var(--font-head); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; min-width: 0;
}
.tabbar a svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.on { color: var(--yellow); }
@media (min-width: 1000px) {
  .mainnav { display: flex; }
  .tabbar { display: none !important; }
}
@media (max-width: 999px) {
  .view { padding-bottom: calc(150px + var(--tab-h) + var(--safe-b)); }
  .capture-bar { bottom: calc(var(--tab-h) + var(--safe-b)); padding-bottom: 12px; }
  .toast { bottom: calc(var(--tab-h) + 90px + var(--safe-b)); }
  .bulk-bar { bottom: calc(var(--tab-h) + 8px + var(--safe-b)); }
}
@media (min-width: 900px) and (max-width: 999px) {
  .capture-bar { position: static; padding: 0; margin-bottom: 20px; }
}

a.stat { display: block; transition: background var(--t); }
a.stat:hover { background: var(--dark3); }
.stats { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 700px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat .num.hot { color: var(--yellow); }
.stat .num.ok, .num-cell.ok { color: var(--ok); }
.stats-sm .stat { padding: 14px 16px; }
.stats-sm .num { font-size: 28px; }
.stats-sm { margin-bottom: 16px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.tab {
  display: flex; align-items: center; gap: 8px; padding: 12px 16px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--muted);
  font-family: var(--font-head); font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
}
.tab svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.tab.on { color: var(--yellow); border-color: var(--yellow); }

/* ---------- Combobox ---------- */
.combo { position: relative; }
.combo-list {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin-top: 4px; max-height: 320px; overflow-y: auto;
  background: var(--dark2); border: 1px solid var(--yellow); border-radius: var(--radius); box-shadow: 0 12px 30px rgba(0,0,0,0.5);
}
.combo-list button { display: block; width: 100%; text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--border); line-height: 1.35; }
.combo-list button:hover, .combo-list button:focus { background: var(--dark3); }
.combo-list .muted { font-size: 13px; }
.combo-empty { padding: 12px 14px; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }
.recent-chips { margin: 8px 0 0; }

/* ---------- Toolbar-Elemente ---------- */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.seg button { padding: 10px 14px; min-height: 44px; color: var(--muted); font-size: 14px; }
.seg button + button { border-left: 1px solid var(--border); }
.seg button.on { background: var(--dark3); color: var(--yellow); }
.date-range { display: inline-flex; align-items: center; gap: 6px; }
.date-range input { width: auto; }

/* ---------- Stunden ---------- */
.num-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.num-cell.hot { color: var(--yellow); }
.strong { font-weight: 600; color: var(--white); }
.note-cell { max-width: 260px; color: var(--muted); font-size: 13px; }
.nr-inline { font-family: var(--font-head); font-weight: 700; color: var(--white); }
table.list .sel { width: 40px; }
table.list input[type=checkbox], .sel-box input { width: 20px; height: 20px; accent-color: var(--yellow); cursor: pointer; }
table.list tr.pending-row td { opacity: 0.7; }
table.list tr.inactive td, .card.inactive { opacity: 0.5; }
table.list tbody tr:not([data-href]) { cursor: default; }
.badge.t-freigegeben { color: var(--ok); border-color: rgba(61,214,140,0.4); }
.badge.t-offen { color: var(--yellow); border-color: rgba(245,195,0,0.35); }
.badge.t-abgelehnt { color: var(--danger); border-color: rgba(229,72,77,0.4); }
.hour-card { align-items: center; }
.hours-big { font-family: var(--font-head); font-size: 22px; font-weight: 800; color: var(--white); white-space: nowrap; }
.sel-box { display: grid; place-items: center; width: 32px; flex: none; }
.card .thumb.avatar { border-radius: 50%; font-family: var(--font-head); font-weight: 800; color: var(--yellow); font-size: 20px; }

.bulk-bar {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 35;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
  background: var(--dark2); border: 1px solid var(--yellow); border-radius: var(--radius); padding: 10px 12px;
  box-shadow: 0 16px 40px rgba(0,0,0,0.6); max-width: calc(100% - 24px);
}
.bulk-bar #bulkCount { font-weight: 600; padding: 0 6px; }

.time-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 12px; }
@media (min-width: 640px) { .time-grid { grid-template-columns: repeat(5, 1fr); } }
input[type=time], input[type=number] {
  width: 100%; min-height: 46px; padding: 12px 14px; border-radius: var(--radius); background: var(--dark3); color: var(--text);
  border: 1px solid var(--border); font: inherit; font-size: 16px; color-scheme: dark;
}
input[type=time]:focus, input[type=number]:focus { outline: none; border-color: var(--yellow); }
.calc { margin: 0 0 16px; padding: 12px 14px; background: var(--dark3); border-left: 3px solid var(--yellow); border-radius: var(--radius); }
.calc:empty { display: none; }
.calc strong { color: var(--white); }
.chips.people .chip { min-height: 44px; }
.form-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 520px) { .form-actions .btn-lg { flex: 1; } }

/* ---------- Plantafel ---------- */
.board-tools { align-items: center; }
.board-label { font-family: var(--font-head); font-size: 18px; letter-spacing: 0.04em; color: var(--white); margin: 0 6px; }
.board-hint { margin-left: auto; }
.board-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 12px; align-items: start; }
.board-side {
  position: sticky; top: calc(var(--top-h) + 12px); max-height: calc(100dvh - var(--top-h) - 40px);
  display: flex; flex-direction: column; gap: 8px; background: var(--dark2); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px;
}
.board-side .search { position: relative; }
.board-side .search input { padding-left: 38px; min-height: 40px; }
.board-side .search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; stroke: var(--muted); fill: none; stroke-width: 2; }
.board-projects { overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.proj-chip {
  padding: 8px 10px; background: var(--dark3); border-left: 3px solid var(--purple-l); border-radius: var(--radius);
  font-size: 13px; line-height: 1.3; cursor: grab; user-select: none;
}
.proj-chip b { font-family: var(--font-head); color: var(--white); font-size: 14px; }
.proj-chip small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-chip:hover { background: var(--mid); }
.board-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table.board { border-collapse: collapse; width: 100%; min-width: 760px; table-layout: fixed; font-size: 13px; }
table.board th, table.board td { border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); }
table.board thead th {
  position: sticky; top: 0; z-index: 2; background: var(--dark2); padding: 9px 6px; text-align: left;
  font-family: var(--font-head); font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
table.board thead th.today { color: var(--yellow); box-shadow: inset 0 -2px 0 var(--yellow); }
table.board .who { width: 160px; position: sticky; left: 0; z-index: 1; background: var(--dark2); text-align: left; padding: 8px 10px; font-weight: 600; }
table.board thead .who { z-index: 3; }
table.board .who a { color: var(--white); }
table.board .who small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }
table.board td { vertical-align: top; padding: 4px; height: 64px; cursor: cell; background: var(--dark); transition: background var(--t); }
table.board td:hover { background: #161616; }
table.board td.today { background: rgba(245,195,0,0.04); }
table.board th.weekend, table.board td.weekend { background: #0c0c0c; }
table.board td.over { background: rgba(245,195,0,0.14); outline: 2px dashed var(--yellow); outline-offset: -3px; }
table.board td.double { box-shadow: inset 0 0 0 2px rgba(229,72,77,0.55); }
table.board td.absent { background: repeating-linear-gradient(45deg, #151515, #151515 6px, #1b1b1b 6px, #1b1b1b 12px); }
table.board tr.unassigned td, table.board tr.unassigned .who { background: #141414; }
.abs { display: block; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding: 2px 4px; }
.order-card {
  display: block; padding: 5px 7px; margin-bottom: 4px; border-radius: var(--radius); cursor: grab; user-select: none;
  background: var(--dark3); border-left: 3px solid var(--yellow); line-height: 1.25; overflow: hidden;
}
.order-card:hover { background: var(--mid); }
.order-card.dragging, .proj-chip.dragging { opacity: 0.4; }
.order-card.s-laufend { border-left-color: var(--ok); }
.order-card.s-erledigt { border-left-color: var(--muted); opacity: 0.65; }
.oc-top { display: flex; align-items: center; gap: 4px; font-family: var(--font-head); color: var(--white); font-size: 13px; }
.oc-team { margin-left: auto; display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: 12px; }
.oc-team svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.oc-title { display: block; color: var(--yellow); font-weight: 600; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-proj { display: block; color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 999px) {
  .board-wrap { grid-template-columns: 1fr; }
  .board-side { position: static; max-height: 220px; }
  .board-hint { display: none; }
}
.time-grid.three { grid-template-columns: 1fr 1fr; }
@media (min-width: 640px) { .time-grid.three { grid-template-columns: repeat(3, 1fr); } }

.badge.o-geplant { color: var(--yellow); border-color: rgba(245,195,0,0.35); }
.badge.o-laufend { color: var(--ok); border-color: rgba(61,214,140,0.4); }
.badge.o-erledigt { color: var(--muted); }
.badge.o-storniert { color: var(--danger); border-color: rgba(229,72,77,0.4); text-decoration: line-through; }
.card[data-order], tr[data-order] { cursor: pointer; }

/* ---------- Meine Einsätze ---------- */
.mission { background: var(--dark2); border: 1px solid var(--border); border-left: 4px solid var(--yellow); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
.mission.s-erledigt { border-left-color: var(--muted); opacity: 0.75; }
.mission.s-laufend { border-left-color: var(--ok); }
.mission h3 { font-size: 22px; margin: 6px 0 4px; }
.m-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.m-proj { display: block; color: var(--white); font-weight: 600; margin-bottom: 2px; }
.m-proj b { font-family: var(--font-head); color: var(--yellow); }
.m-addr { display: inline-block; color: var(--yellow); margin: 6px 0; }
.mission a svg { width: 14px; height: 14px; vertical-align: -2px; stroke: currentColor; fill: none; stroke-width: 2; }
.m-desc { white-space: pre-wrap; background: var(--dark3); padding: 10px 12px; border-radius: var(--radius); margin: 8px 0; font-size: 15px; }
.m-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.m-actions .btn-primary { flex: 1 1 100%; }
@media (min-width: 520px) { .m-actions .btn-primary { flex: 0 1 auto; } }
.small-empty { padding: 18px; }

/* ---------- Ressourcen ---------- */
.plate {
  display: inline-flex; align-items: center; padding: 1px 8px 1px 14px; position: relative; white-space: nowrap;
  background: #f4f4f4; color: #111; border: 2px solid #111; outline: 1px solid #555; border-radius: 4px;
  font-family: var(--font-head); font-weight: 700; font-size: 14px; letter-spacing: 0.06em; line-height: 1.35;
}
.plate::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: #1f4fbf; border-radius: 2px 0 0 2px; }
.res-group { margin-bottom: 24px; }
.res-group h3 { margin-bottom: 10px; }
.res-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; }
.res-card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; background: var(--dark2); border: 1px solid var(--border);
  border-left: 4px solid var(--border); border-radius: var(--radius); transition: background var(--t);
}
.res-card:hover { background: var(--dark3); }
.res-card.st-overdue { border-left-color: var(--danger); }
.res-card.st-due { border-left-color: var(--yellow); }
.res-card.st-ok { border-left-color: var(--ok); }
.res-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.res-top strong { color: var(--white); }
.res-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.res-foot svg, .doc-list svg { width: 15px; height: 15px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; }
.badge.c-overdue { color: #fff; background: var(--danger); border-color: var(--danger); }
.badge.c-due { color: var(--dark); background: var(--yellow); border-color: var(--yellow); }
.badge.c-ok { color: var(--ok); border-color: rgba(61,214,140,0.4); }
.badge.c-none { color: var(--muted); }
.block { display: block; }
.res-section { margin-top: 30px; }
.section-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-bar .actions { display: flex; flex-wrap: wrap; gap: 8px; }
fieldset.eq-check { border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px 4px; margin: 0 0 16px; }
fieldset.eq-check legend { padding: 0 6px; font-weight: 700; }
fieldset.eq-check .hint { margin: -6px 0 10px; }
details.returned { margin-top: 16px; }
details.returned summary { cursor: pointer; color: var(--muted); padding: 6px 0; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 13px; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; }
.doc-list { list-style: none; display: grid; gap: 2px; }
.doc-list li { display: flex; align-items: center; gap: 6px; background: var(--dark2); padding: 6px 8px 6px 12px; }
.doc-main { flex: 1; display: flex; align-items: center; gap: 12px; min-width: 0; padding: 6px 0; }
.doc-main strong { color: var(--white); }
.doc-icon {
  flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: var(--radius); background: var(--dark3);
  font-family: var(--font-head); font-weight: 800; font-size: 12px; letter-spacing: 0.06em; color: var(--muted);
}
.doc-icon.pdf { color: #ff6b6b; }
.doc-icon.img { color: var(--purple-l); }
.due-box { background: rgba(229,72,77,0.07); border: 1px solid rgba(229,72,77,0.45); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 20px; }
.due-box h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.due-box h3 svg { width: 20px; height: 20px; stroke: var(--danger); fill: none; stroke-width: 2; }
.due-box ul { list-style: none; display: grid; gap: 4px; }
.due-box a { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; }
.due-box a:hover strong { color: var(--yellow); }
.howto { margin: 12px 0 12px 18px; display: grid; gap: 6px; font-size: 15px; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; margin-left: 2px; border-radius: 9px;
  background: var(--yellow); color: var(--dark); font-family: var(--font-body); font-size: 11px; font-weight: 700; letter-spacing: 0;
}
.nav-badge.hot { background: var(--danger); color: #fff; }
.tabbar a { position: relative; }
.tabbar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
.chip.warn { border-color: rgba(229,72,77,0.6); color: #ff8a8a; }
.chip.warn.on { color: var(--yellow); }
.m-res a { color: var(--yellow); }

/* Plantafel: Ressourcen-Zeilen */
table.board tr.sep th { background: var(--dark3); color: var(--yellow); font-family: var(--font-head); letter-spacing: 0.12em; text-transform: uppercase; font-size: 12px; padding: 8px 10px; }
table.board tr.sep svg { width: 16px; height: 16px; vertical-align: -3px; fill: none; stroke: currentColor; stroke-width: 2; }
table.board tr.res-row td { height: 48px; background: #0f0f0f; }
table.board tr.res-row .order-card { border-left-color: var(--purple-l); }
.warn-dot { color: var(--danger); }
.oc-res { display: flex; align-items: center; gap: 3px; color: var(--purple-l); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.oc-res svg { width: 12px; height: 12px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; }

/* Logo */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-logo { height: 30px; width: auto; display: block; }
.login-card .brand { display: flex; }
.login-card .brand-logo { height: 52px; }
.report .r-logo { height: 44px; width: auto; display: block; margin-bottom: 6px; }
@media (max-width: 420px) { .brand-logo { height: 24px; } }

/* Persönlicher Planer */
.planner-grid { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 960px) { .planner-grid { grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; } }
button.stat { text-align: left; width: 100%; cursor: pointer; color: inherit; font: inherit; border: 0; }
button.stat:hover, a.stat:hover { background: var(--dark3); }
.week-nav { align-items: center; }
.quick-add { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; margin-bottom: 12px; }
.quick-add input[type=date] { width: 150px; }
@media (max-width: 520px) { .quick-add { grid-template-columns: 1fr auto; } .quick-add input[type=date] { grid-column: 1; width: 100%; } .quick-add button { grid-row: 1; grid-column: 2; } }
.todo-group { font-size: 15px; margin: 16px 0 6px; text-transform: uppercase; letter-spacing: 0.04em; }
.todo-group.late { color: var(--danger); }
.todo-list { list-style: none; display: grid; gap: 2px; }
.todo { display: grid; grid-template-columns: 44px 1fr; align-items: center; background: var(--dark2); }
.todo-check { width: 44px; height: 44px; display: grid; place-items: center; }
.todo-check svg { width: 22px; height: 22px; padding: 2px; border: 2px solid var(--muted); border-radius: 50%; stroke: transparent; fill: none; stroke-width: 3; }
.todo-check:hover svg { border-color: var(--yellow); stroke: var(--muted); }
.todo.done .todo-check svg { background: var(--ok); border-color: var(--ok); stroke: var(--dark); }
.todo.done .todo-title { text-decoration: line-through; color: var(--muted); }
.todo-main { text-align: left; padding: 10px 12px 10px 0; display: grid; gap: 4px; min-width: 0; }
.todo-title { font-weight: 600; overflow-wrap: anywhere; }
.prio-mark { color: var(--dark); background: var(--yellow); font-weight: 900; padding: 0 6px; margin-right: 6px; border-radius: 2px; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
.todo-meta svg, .todo-links svg, .ag-links svg, .ag-item svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; vertical-align: -2px; margin-right: 3px; }
.todo-meta .late { color: var(--danger); font-weight: 700; }
.todo-meta .today { color: var(--yellow); font-weight: 700; }
.todo-links, .ag-links { grid-column: 2; padding: 0 12px 10px 0; font-size: 13px; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.todo-links a, .ag-links a { color: var(--yellow); }
.badge.cat-Anfrage { color: #fff; background: var(--purple); border-color: var(--purple); }
.badge.cat-Angebot { color: var(--dark); background: var(--yellow); border-color: var(--yellow); }
.badge.cat-Rückruf { color: var(--ok); border-color: rgba(61,214,140,0.5); }
.ag-day { margin-bottom: 16px; }
.ag-day h3 { font-size: 15px; margin-bottom: 6px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.ag-day.today h3 { color: var(--yellow); }
.ag-day ul { list-style: none; display: grid; gap: 2px; }
.ag-day li { background: var(--dark2); display: grid; grid-template-columns: 1fr; }
.ag-day .ag-links { grid-column: 1; padding-left: 104px; }
.ag-item { display: grid; grid-template-columns: 92px 1fr; gap: 12px; padding: 10px 12px; text-align: left; width: 100%; }
.ag-item.termin .ag-time { color: var(--yellow); }
.ag-item.start .ag-time { color: var(--purple-l); }
.ag-item.einsatz .ag-time { color: var(--ok); }
.ag-item:hover strong { color: var(--yellow); }
.ag-time { font-family: var(--font-head); font-weight: 700; color: var(--muted); font-size: 14px; text-transform: uppercase; }
.ag-time.late { color: var(--danger); }
.my-day { background: var(--dark2); padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 24px; }
.my-day-list { list-style: none; display: grid; gap: 4px; }
.my-day-list a { display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; padding: 6px 0; }
.my-day-list .ag-time { min-width: 92px; }
.my-day-list a:hover strong { color: var(--yellow); }

/* Kopfzeile: Logo nie stauchen; bei weniger Breite Menü kompakter, dann nur Symbole */
.topbar .brand { flex-shrink: 0; }
.mainnav { min-width: 0; }
@media (max-width: 1499px) {
  .mainnav { margin-left: 12px; }
  .mainnav a { padding: 8px 8px; gap: 5px; letter-spacing: 0.05em; }
  .topbar .brand > span { display: none; }
}
@media (max-width: 1239px) {
  .mainnav a span:not(.nav-badge) { display: none; }
  .mainnav a { padding: 8px 10px; position: relative; }
  .mainnav a .nav-badge { position: absolute; top: 0; right: 0; margin: 0; }
}
.seg button { display: inline-flex; align-items: center; gap: 6px; }
.seg svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; }
.tabbar a { letter-spacing: 0.02em; padding: 0 2px; }
.tabbar a > span:not(.nav-badge) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 430px) { .tabbar a { font-size: 9.5px; } }
.mail-status { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.mail-status svg, .badge.mail svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; margin-right: 4px; }
.mail-status.err strong { color: var(--danger); }
.badge.mail { color: var(--text); }
.mail-hint { margin-bottom: 12px; }
.mail-hint svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; vertical-align: -2px; margin-right: 4px; }
@media (min-width: 700px) { .sheet.sheet-wide { max-width: 920px; } }
textarea.mail-text { min-height: 280px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; background: var(--dark); }
