:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #1a1d23;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #f59e0b;
  --accent-ink: #92400e;
  --accent-soft: #fef3c7;
  --blue: #2563eb;
  --green: #059669;
  --red: #dc2626;
  --side: #111827;
  --side-text: #d1d5db;
  --side-hover: #1f2937;
  --side-strong: #ffffff;
  --accent-on: #111111;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 1px 3px rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif;
  font-size: 14px; color: var(--text); background: var(--bg);
}
a { color: var(--blue); text-decoration: none; }
h1 { font-size: 22px; margin: 0; }
h2 { font-size: 16px; margin: 0 0 12px; }
h3 { font-size: 14px; margin: 0 0 8px; }
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; background: var(--side); color: var(--side-text);
  padding: 18px 12px; border-right: 1px solid rgba(0,0,0,.06); position: sticky; top: 0; height: 100vh; flex-shrink: 0;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--side-strong); font-size: 16px; padding: 4px 10px 20px; }
.brand-logo { max-width: 36px; max-height: 36px; object-fit: contain; border-radius: 6px; }
.brand-logo.wide { max-width: 190px; max-height: 84px; margin: -10px 0 -6px -8px; }
.brand-dot { width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--accent-soft), var(--accent)); }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.sidebar nav a { color: var(--side-text); padding: 9px 12px; border-radius: 8px; }
.sidebar nav a:hover { background: var(--side-hover); color: var(--side-strong); }
.sidebar nav a.active { background: var(--accent); color: var(--accent-on); font-weight: 600; }
main { flex: 1; padding: 24px 28px 60px; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 760px) {
  .shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; }
  .sidebar nav { flex-direction: row; flex-wrap: wrap; }
  .g2, .g3, .g4 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
  main { padding: 16px; }
}
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.kpi .value { font-size: 26px; font-weight: 700; margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .hint { color: var(--muted); font-size: 12px; margin-top: 2px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff;
  padding: 8px 14px; border-radius: 8px; cursor: pointer; font: inherit; color: var(--text); font-weight: 500;
}
.btn:hover { background: #f3f4f6; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on); font-weight: 600; }
.btn.primary:hover { filter: brightness(.95); }
.btn.danger { color: var(--red); }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
input, select, textarea {
  font: inherit; border: 1px solid #d1d5db; border-radius: 8px; padding: 8px 10px; background: #fff; color: var(--text); width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: var(--accent); }
textarea { min-height: 80px; resize: vertical; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 500; }
label.f > span { text-transform: uppercase; letter-spacing: .03em; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
input[type=checkbox] { width: auto; }
input[type=color] { height: 38px; padding: 3px; cursor: pointer; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; background: #fafafa; }
tr.click { cursor: pointer; }
tr.click:hover td { background: var(--accent-soft); }
.table-wrap { overflow-x: auto; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f3f4f6; color: #374151; white-space: nowrap; }
.badge.neu { background: #dbeafe; color: #1e40af; }
.badge.kontaktiert { background: #e0e7ff; color: #3730a3; }
.badge.termin { background: #fae8ff; color: #86198f; }
.badge.angebot { background: #fef3c7; color: #92400e; }
.badge.gewonnen, .badge.angenommen, .badge.abgeschlossen { background: #d1fae5; color: #065f46; }
.badge.verloren, .badge.abgelehnt { background: #fee2e2; color: #991b1b; }
.badge.entwurf { background: #f3f4f6; color: #374151; }
.badge.versendet { background: #fef3c7; color: #92400e; }
/* Kanban */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 8px; }
.lane { background: #eef0f3; border-radius: var(--radius); padding: 10px; min-height: 300px; }
.lane.over { outline: 2px dashed var(--accent); }
.lane-head { display: flex; justify-content: space-between; font-weight: 600; margin-bottom: 8px; font-size: 13px; }
.lane-head .muted { font-weight: 400; }
.kcard { background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: grab; border-left: 3px solid var(--accent); }
.kcard:active { cursor: grabbing; }
.kcard .t { font-weight: 600; }
.kcard .m { color: var(--muted); font-size: 12px; margin-top: 3px; }
/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button { background: none; border: none; padding: 10px 14px; font: inherit; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(17,24,39,.45); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px; z-index: 2000; overflow-y: auto; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 640px; padding: 20px; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.modal.wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.x { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--muted); }
#toast-root { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 3000; }
.toast { background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); }
.toast.err { background: var(--red); }
/* Timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 8px 0 8px 16px; border-left: 2px solid var(--line); position: relative; }
.timeline li::before { content: ""; position: absolute; left: -5px; top: 13px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.timeline .when { color: var(--muted); font-size: 12px; }
/* Map / Planning */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; }
@media (max-width: 1100px) { .plan-layout { grid-template-columns: 1fr; } }
#map { height: 620px; border-radius: var(--radius); border: 1px solid var(--line); }
.map-tools { position: absolute; top: 10px; left: 54px; z-index: 1000; display: flex; gap: 6px; flex-wrap: wrap; }
.map-tools .btn { box-shadow: var(--shadow); }
.map-wrap { position: relative; }
.map-hint { position: absolute; bottom: 10px; left: 10px; z-index: 1000; background: rgba(17,24,39,.85); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; }
.roof { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; }
.roof.sel { border-color: var(--accent); background: var(--accent-soft); }
.roof-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 8px; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.stat-line { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed var(--line); }
.stat-line:last-child { border-bottom: none; }
.stat-line b { font-variant-numeric: tabular-nums; }
/* Charts */
.chart svg { width: 100%; height: auto; display: block; }
.chart text { font-size: 11px; fill: var(--muted); }
/* Checklist */
.check { display: flex; gap: 8px; align-items: center; padding: 4px 0; }
.check input { width: 16px; height: 16px; }
.phase-bar { display: flex; gap: 4px; margin: 10px 0 18px; flex-wrap: wrap; }
.phase-bar button { flex: 1; min-width: 90px; padding: 8px 6px; border: 1px solid var(--line); background: #fff; border-radius: 6px; cursor: pointer; font-size: 12px; font: inherit; font-size: 12px; }
.phase-bar button.done { background: #d1fae5; border-color: #a7f3d0; color: #065f46; }
.phase-bar button.cur { background: var(--accent); border-color: var(--accent); color: var(--accent-on); font-weight: 600; }
/* Calendar */
.cal { display: grid; grid-template-columns: 160px repeat(7, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.cal > div { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 6px; min-height: 90px; }
.cal .ch { background: #fafafa; min-height: auto; font-weight: 600; font-size: 12px; }
.cal .ch.today { background: var(--accent-soft); }
.cal .team { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.cal .cell { cursor: pointer; }
.cal .cell:hover { background: var(--accent-soft); }
.cal .ev { color: #fff; padding: 4px 6px; border-radius: 5px; font-size: 12px; margin-bottom: 4px; cursor: pointer; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.empty { text-align: center; color: var(--muted); padding: 40px; }
.qitems input { padding: 5px 7px; }
.qitems td { padding: 5px 6px; }
.qitems td:nth-child(2) { min-width: 260px; }
.qitems td:nth-child(3), .qitems td:nth-child(5) { min-width: 80px; }
.qitems td:nth-child(4) { min-width: 60px; }
.sum-box { margin-left: auto; width: 320px; max-width: 100%; }
.pill-toggle { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.pill-toggle button { border: none; background: #fff; padding: 7px 12px; cursor: pointer; font: inherit; }
.pill-toggle button.active { background: var(--accent); color: var(--accent-on); font-weight: 600; }

/* --------- Druckansicht Angebot --------- */
.print-only { display: none; }
@media print {
  @page { size: A4; margin: 16mm 16mm 18mm; }
  body { background: #fff; }
  .sidebar, .no-print, #toast-root { display: none !important; }
  main { padding: 0; }
  .print-only { display: block; }
  .doc { box-shadow: none !important; border: none !important; padding: 0 !important; }
  .page-break { page-break-before: always; }
}
.doc { background: #fff; max-width: 820px; margin: 0 auto; padding: 48px 56px; box-shadow: var(--shadow); border: 1px solid var(--line); color: #111; font-size: 13px; line-height: 1.45; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-start; border-bottom: 3px solid var(--accent); padding-bottom: 14px; margin-bottom: 26px; }
.doc-logo { font-size: 20px; font-weight: 800; }
.doc-logo img { max-height: 60px; max-width: 220px; }
.doc-sender { font-size: 11px; color: #555; text-align: right; }
.doc-addr { margin-bottom: 26px; }
.doc-addr .sender-line { font-size: 9px; color: #777; text-decoration: underline; margin-bottom: 6px; }
.doc-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; font-size: 12px; justify-content: end; }
.doc h1 { font-size: 20px; margin: 10px 0 14px; }
.doc table th { background: #f6f6f6; color: #333; }
.doc table td, .doc table th { padding: 7px 8px; font-size: 12px; }
.doc .totals { width: 300px; margin-left: auto; margin-top: 10px; }
.doc .totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.doc .totals .grand { border-top: 2px solid #111; font-weight: 700; font-size: 15px; padding-top: 8px; margin-top: 4px; }
.doc .facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
.doc .fact { background: #fafafa; border: 1px solid #eee; border-radius: 6px; padding: 10px; }
.doc .fact .v { font-size: 17px; font-weight: 700; }
.doc .fact .l { font-size: 10px; color: #666; text-transform: uppercase; }
.doc-foot { margin-top: 40px; padding-top: 10px; border-top: 1px solid #ddd; font-size: 10px; color: #666; display: flex; justify-content: space-between; gap: 10px; }
.sign { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; margin-top: 50px; }
.sign div { border-top: 1px solid #333; padding-top: 4px; font-size: 11px; }

/* Anlagenvisualisierung im Angebot */
.doc-visual { margin: 18px 0 22px; page-break-inside: avoid; break-inside: avoid; }
.doc-visual h1 { margin-bottom: 12px; }
.doc-visual img.main { width: 100%; border-radius: 6px; display: block; }
.doc-visual-row { display: flex; gap: 14px; margin-top: 10px; align-items: flex-start; }
.doc-visual-row figure { margin: 0; width: 46%; flex: none; }
.doc-visual-row figure img { width: 100%; border-radius: 6px; display: block; }
.doc-visual-row figcaption { font-size: 10px; color: #666; margin-top: 3px; }
.doc-visual .facts { flex: 1 1 0; min-width: 0; width: auto; margin: 0; font-size: 12px; }
.doc-visual .facts td { padding: 4px 6px; border-bottom: 1px solid #eee; vertical-align: top; }
.doc-visual .facts td:first-child { color: #666; white-space: nowrap; }

/* ---------------- Nutzer, Anmeldung */
.sidebar { display: flex; flex-direction: column; overflow-y: auto; }
.side-user { margin-top: auto; padding-top: 14px; border-top: 1px solid rgba(127,127,127,.2); display: flex; align-items: center; gap: 6px; }
.side-user-link { display: flex; align-items: center; gap: 10px; color: var(--side-strong); flex: 1; min-width: 0; padding: 6px; border-radius: 8px; line-height: 1.25; }
.side-user-link:hover { background: var(--side-hover); }
.side-user-link span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-link .small { color: var(--side-text); }
.side-logout { background: none; border: none; color: var(--side-text); font-size: 17px; cursor: pointer; padding: 6px 8px; border-radius: 8px; }
.side-logout:hover { background: var(--side-hover); color: var(--side-strong); }
.avatar { border-radius: 50%; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; flex: none; background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; }
.perm-box { margin-top: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafafa; }
.perm-box .check { display: flex; gap: 8px; align-items: center; padding: 3px 0; }
.perm-admin-note { display: none; color: var(--accent-ink); font-weight: 600; }
.perm-box[data-admin] .perm-admin-note { display: block; }
.perm-box[data-admin] .check { opacity: .55; }

body.auth-mode .shell { display: none; }
#auth-root:empty { display: none; }
.auth-wrap { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(380px, 1fr); min-height: 100vh; background: #fff; }
.auth-visual { background-size: cover; background-position: center; position: relative; }
.auth-visual::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,0) 45%, rgba(0,0,0,.55)); }
.auth-visual-text { position: absolute; left: 40px; right: 40px; bottom: 40px; z-index: 1; color: #fff; }
.auth-claim { font-size: 26px; font-weight: 700; line-height: 1.25; max-width: 520px; text-shadow: 0 2px 12px rgba(0,0,0,.3); }
.auth-side { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h1 { font-size: 26px; margin: 18px 0 6px; }
.auth-logo { max-height: 64px; max-width: 220px; }
.auth-name { font-size: 22px; font-weight: 800; }
.auth-error { color: var(--red); font-weight: 600; min-height: 1em; }
.auth-foot { margin-top: 40px; color: var(--muted); font-size: 12px; }
.btn.big { padding: 12px 16px; font-size: 15px; justify-content: center; width: 100%; }
.auth-pick { display: grid; gap: 8px; }
.auth-user { display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; cursor: pointer; }
.auth-user:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.auth-user input { margin: 0; width: auto; flex: none; }
.auth-user > span:last-child { flex: 1; min-width: 0; }
@media (max-width: 820px) { .auth-wrap { grid-template-columns: 1fr; } .auth-visual { min-height: 180px; } }

/* ---------------- Angebots-PDF (A4-Seiten) */
.op-doc { --op-accent: #cfcf15; display: flex; flex-direction: column; align-items: center; gap: 18px; padding-bottom: 40px; color: #1d2019; }
.op-page { width: 210mm; height: 297mm; background: #fff; position: relative; overflow: hidden; box-shadow: 0 2px 14px rgba(0,0,0,.12); display: flex; flex-direction: column; font-size: 10.5pt; line-height: 1.5; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, sans-serif; }
.op-head { display: flex; justify-content: space-between; align-items: center; padding: 11mm 16mm 0; height: 22mm; flex: none; }
.op-head img { max-height: 10mm; max-width: 45mm; }
.op-label { font-size: 8.5pt; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--op-ink); border-left: 3px solid var(--op-accent); padding-left: 8px; }
.op-body { flex: 1; padding: 4mm 16mm 6mm; overflow: hidden; min-height: 0; }
.op-h1 { font-size: 22pt; line-height: 1.15; margin: 2mm 0 6mm; font-weight: 800; letter-spacing: -.01em; }
.op-h1.cont { font-size: 14pt; color: #666; margin-bottom: 4mm; }
.op-h2 { font-size: 12pt; margin: 6mm 0 3mm; font-weight: 700; }
.op-body p { margin: 0 0 3mm; }
.op-body .pre { white-space: pre-wrap; }
.op-note { font-size: 8pt; color: #777; margin-top: 3mm !important; }
.op-foot { flex: none; height: 24mm; background: var(--op-foot-bg); color: var(--op-foot-c); padding: 5mm 16mm 0; position: relative; font-size: 7.5pt; line-height: 1.45; }
.op-foot-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; }
.op-pno { position: absolute; right: 16mm; bottom: 3mm; font-size: 7.5pt; opacity: .7; }

.op-cover { }
.op-cover-img { height: 192mm; background-size: cover; background-position: center; position: relative; flex: none; }
.op-card { position: absolute; top: 12mm; background: rgba(255,255,255,.96); border-radius: 3mm; padding: 4mm 5mm; font-size: 9pt; line-height: 1.45; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.op-card-cust { left: 12mm; max-width: 80mm; }
.op-card-contact { right: 12mm; display: flex; gap: 4mm; align-items: center; overflow: hidden; padding-right: 11mm; }
.op-card-contact img { width: 15mm; height: 15mm; border-radius: 50%; object-fit: cover; }
.op-ribbon { position: absolute; top: 3mm; right: -9mm; transform: rotate(45deg); background: var(--op-accent); color: var(--op-on); font-size: 6pt; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; padding: 1px 10mm; }
.op-cover-text { padding: 16mm 18mm 0; }
.op-cover-text h1 { font-size: 28pt; line-height: 1.1; margin: 0 0 2mm; font-weight: 800; }
.op-cover-sub { font-size: 13pt; font-weight: 700; }
.op-cover-meta { margin-top: 3mm; color: #666; }
.op-cover-logo { position: absolute; left: 18mm; bottom: 16mm; max-height: 16mm; max-width: 60mm; }

.op-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 3mm; margin: 5mm 0; }
.op-tiles.small { grid-template-columns: 1fr 1fr; margin-top: 0; }
.op-tile { background: var(--op-soft); border-radius: 3mm; padding: 4mm; }
.op-tile .v { font-size: 15pt; font-weight: 800; line-height: 1.15; }
.op-tile .l { font-size: 8.5pt; color: #555; margin-top: 1mm; }
.op-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 6mm; }
.op-group { border-top: 2px solid var(--op-accent); padding-top: 2mm; }
.op-group-h { display: flex; justify-content: space-between; font-size: 10.5pt; }
.op-group ul { margin: 1.5mm 0 0; padding-left: 4.5mm; font-size: 9pt; color: #444; }
.op-total { margin: 6mm 0 0 auto; width: 88mm; }
.op-total.compact { margin-top: 2mm; }
.op-total > div { display: flex; justify-content: space-between; padding: 1.3mm 0; border-bottom: 1px solid #ecece6; }
.op-total .big { background: var(--op-accent); color: var(--op-on); border: none; padding: 3mm 4mm; border-radius: 2.5mm; margin-top: 2mm; font-size: 13pt; }
.op-hero { width: 100%; border-radius: 3mm; display: block; max-height: 112mm; object-fit: cover; }
.op-two { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin-top: 5mm; align-items: start; }
.op-fig { margin: 0; } .op-fig img { width: 100%; border-radius: 3mm; display: block; } .op-fig figcaption { font-size: 8pt; color: #777; margin-top: 1mm; }
.op-kv { width: 100%; border-collapse: collapse; font-size: 9pt; }
.op-kv td { padding: 1.6mm 1mm; border-bottom: 1px solid #ecece6; vertical-align: top; }
.op-kv td:first-child { color: #666; white-space: nowrap; padding-right: 4mm; }
.op-comps { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.op-comp { border: 1px solid #e6e6df; border-radius: 3mm; padding: 4mm; }
.op-comp-cat { font-size: 7.5pt; text-transform: uppercase; letter-spacing: .1em; color: var(--op-ink); font-weight: 700; }
.op-comp-n { font-weight: 800; font-size: 11pt; margin-top: 1mm; line-height: 1.25; }
.op-comp-m { font-size: 8.5pt; color: #666; margin-top: 1mm; }
.op-comp ul { margin: 2mm 0 0; padding-left: 4.5mm; font-size: 8.5pt; color: #444; }
.op-chart { width: 100%; display: block; }
.op-donuts { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; margin: 4mm 0 6mm; }
.op-donut { display: flex; align-items: center; gap: 4mm; }
.op-donut svg { width: 34mm; height: 34mm; flex: none; }
.op-donut-l { font-weight: 800; font-size: 11pt; } .op-donut-l span { font-weight: 400; font-size: 8.5pt; color: #666; }
.op-cmp > div { display: grid; grid-template-columns: 26mm 1fr 22mm; gap: 2mm; align-items: center; margin-bottom: 2mm; font-size: 9pt; }
.op-cmp .bar { height: 6mm; border-radius: 1.5mm; }
.op-cmp b { text-align: right; }
.op-items { width: 100%; border-collapse: collapse; font-size: 9pt; }
.op-items th { text-align: left; font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; color: #666; border-bottom: 2px solid var(--op-accent); padding: 2mm 1.5mm; }
.op-items td { padding: 2mm 1.5mm; border-bottom: 1px solid #ecece6; vertical-align: top; }
.op-items .r { text-align: right; white-space: nowrap; }
.op-items .muted { color: #777; font-size: 8.5pt; }
.op-sign { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10mm; margin-top: 14mm; font-size: 8.5pt; color: #666; }
.op-sign .line { border-bottom: 1px solid #333; height: 12mm; margin-bottom: 1.5mm; }
.op-legal-terms { background: var(--op-soft); border-radius: 3mm; padding: 4mm 5mm; margin-bottom: 5mm; }
.op-legal-terms p { margin: 0 0 1.5mm; }
.op-small .op-legal { font-size: 7.6pt; line-height: 1.42; column-count: 2; column-gap: 7mm; }
.op-legal h1, .op-legal h2, .op-legal h3, .op-legal h4 { font-size: 8.6pt; margin: 2mm 0 1mm; break-after: avoid; }
.op-legal p { margin: 0 0 1.6mm; }
.op-legal ul, .op-legal ol { margin: 0 0 1.6mm; padding-left: 4mm; }
.wf-line { border-bottom: 1px solid #333; height: 9mm; }
.wf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm 8mm; margin-top: 4mm; }
.wf-grid span { font-size: 8pt; color: #666; }
.op-small .op-legal:has(.wf-line) { column-count: 1; font-size: 9.5pt; }

@media print {
  .op-doc { gap: 0; padding: 0; display: block; }
  .op-page { box-shadow: none; page-break-after: always; break-after: page; margin: 0; }
  .op-page:last-child { page-break-after: auto; break-after: auto; }
  body:has(.op-doc) main { padding: 0 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.op-term { display: grid; grid-template-columns: 16mm 1fr; gap: 3mm; padding: 1.6mm 0; border-top: 1px solid rgba(0,0,0,.07); }
.op-term b { font-size: 12pt; color: var(--op-ink); }
.op-legal-terms > p:first-child { font-weight: 700; margin-bottom: 2mm; }
.op-one .op-legal { column-count: 1 !important; font-size: 9pt !important; line-height: 1.5 !important; }
.od-covers { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.od-cover { border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; padding: 0; background: none; aspect-ratio: 3 / 2; }
.od-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.od-cover.sel { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.od-rich { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; min-height: 120px; max-height: 360px; overflow: auto; background: #fff; font-size: 13px; line-height: 1.5; }
.od-rich:focus { outline: 2px solid var(--accent); }
.od-rich p { margin: 0 0 6px; }

.bom-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: #fafafa; }
table.bom { width: 100%; margin: 8px 0; }
table.bom td, table.bom th { padding: 3px 4px; }
table.bom input { padding: 5px 6px; }
.wb { display: grid; grid-template-columns: 110px 1fr; gap: 14px; margin-bottom: 12px; }
.wb-date { display: flex; flex-direction: column; gap: 4px; border-right: 3px solid var(--accent); padding-right: 10px; }
.wb-date b { font-size: 16px; }
@media (max-width: 640px) { .wb { grid-template-columns: 1fr; } .wb-date { border-right: none; border-bottom: 3px solid var(--accent); padding-bottom: 6px; flex-direction: row; gap: 10px; } }

/* Seitenleiste: aufklappbare Bereiche */
.sidebar .nav-sec { margin-top: 6px; }
.sidebar .nav-group { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; font-weight: 700; color: var(--side-text); opacity: .75; padding: 10px 12px 4px; border-radius: 6px; }
.sidebar .nav-group:hover { opacity: 1; color: var(--side-strong); }
.sidebar .nav-group .chev { transition: transform .18s ease; }
.sidebar .nav-sec.closed .chev { transform: rotate(-90deg); }
.sidebar .nav-items { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.sidebar .nav-sec.closed .nav-items { display: none; }
.sidebar .nav-sec.closed.has-active .nav-items { display: flex; }
.hr-amt.masked { filter: blur(6px); user-select: none; }

.oh-calc { width: 100%; }
.oh-calc td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.oh-calc tr.sum td { font-weight: 700; border-top: 2px solid var(--line); }
.oh-calc tr.total td { font-weight: 800; font-size: 17px; background: var(--accent-soft); }
.oh-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; margin-bottom: 10px; background: #f3f4f6; }
.oh-tbl { width: 100%; }
.oh-tbl td { padding: 3px 4px; }
.oh-tbl input, .oh-tbl select { padding: 5px 7px; }
.oh-tbl tr.off { opacity: .45; }

/* Service: Anruf-Board & Tickets */
.nav-badge { background: #dc2626; color: #fff; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; margin-left: 6px; }
.calls { display: grid; gap: 10px; }
.call { padding: 12px 14px; border-left: 4px solid var(--line); }
.call.is-new { border-left-color: var(--accent); }
.call.is-urgent { border-left-color: #dc2626; background: #fffafa; }
.call-head { display: flex; gap: 8px; align-items: center; }
.call-cat, .tk-type { font-size: 11px; font-weight: 700; color: var(--c); background: color-mix(in srgb, var(--c) 12%, white); border: 1px solid color-mix(in srgb, var(--c) 30%, white); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.call-urg { font-size: 11px; font-weight: 700; color: #fff; background: #dc2626; padding: 1px 8px; border-radius: 999px; }
.call-sum { margin: 6px 0; }
.call-meta { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); }
.call-actions { margin-top: 8px; }
.call-tr { white-space: pre-wrap; background: #f8f8f6; border-radius: 8px; padding: 10px; font-size: 12px; max-height: 320px; overflow: auto; margin: 8px 0 4px; font-family: inherit; }
.tk-prio { font-size: 11px; color: var(--c); font-weight: 700; }
.tk-board { display: grid; grid-template-columns: repeat(4, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; }
.tk-col { background: #eef0f3; border-radius: var(--radius); padding: 10px; min-height: 320px; }
.tk-col.over { outline: 2px dashed var(--accent); }
.tk-card { background: #fff; border-radius: 8px; padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.tk-card.drag { opacity: .5; }
.tk-title { font-weight: 600; margin: 6px 0 2px; }
.tk-feed { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.tk-c { display: flex; gap: 10px; }
.tk-bubble { background: #f6f7f9; border-radius: 10px; padding: 8px 12px; margin-top: 3px; white-space: pre-wrap; }
.tk-ev { padding-left: 40px; }
#cl .sel { background: var(--accent-soft); border-radius: 6px; }

/* Lager */
.book-row { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.book-row .qty { display: flex; align-items: center; gap: 4px; }
.book-row .qty input { width: 64px; text-align: center; padding: 6px; }
.tlist { max-height: 260px; overflow: auto; margin-bottom: 8px; }
.tlist .sel { background: var(--accent-soft); border-radius: 6px; }
.sel-target { background: var(--accent-soft); border-radius: 8px; padding: 8px 10px; font-weight: 600; }

/* Preisimport */
.pl-steps { display: flex; gap: 6px; margin-bottom: 14px; }
.pl-steps span { padding: 6px 12px; border-radius: 999px; background: #eef0f3; color: var(--muted); font-size: 13px; font-weight: 600; }
.pl-steps span.on { background: var(--accent); color: var(--accent-on); }
.pl-drop { display: block; border: 2px dashed var(--line); border-radius: 12px; padding: 36px; text-align: center; margin-top: 14px; cursor: pointer; }
.pl-drop.over, .pl-drop:hover { border-color: var(--accent); background: var(--accent-soft); }

/* Abwesenheiten im Montagekalender */
.cell.abs-row { min-height: 0; padding: 4px; background: #fafaf7; cursor: default; }
.abs-chip { display: inline-block; font-size: 11px; background: #eef2ff; color: #3730a3; border-radius: 99px; padding: 1px 7px; margin: 1px 2px 1px 0; white-space: nowrap; }
.abs-chip.req { background: #fef3c7; color: #92400e; }
.ev-warn { margin-top: 3px; background: rgba(255,255,255,.92); color: #b91c1c; border-radius: 4px; padding: 1px 4px; font-size: 11px; font-weight: 700; }
.cal > div.abs-row { min-height: 0; background: #fafaf7; }
.cal .cell.abs-row:hover { background: #fafaf7; }
