/* Baustellenpläne – im Stil des ROVEX-Planers (dunkel). */
#view-siteplans { --sp-line: rgba(255,255,255,.10); --sp-muted: #b8b8bd; --sp-soft: rgba(255,255,255,.04); --sp-bad: #ff8a8a; --sp-warn: #f5b862; --sp-ok: #7fd3a4; --lw: 300px; --cw: 22px; }
#view-siteplans [hidden], #sp-dialog [hidden] { display: none !important; }
.sp-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 18px; }
.sp-head h2 { margin: 6px 0 6px; font-size: 28px; letter-spacing: -.5px; }
.sp-head p { margin: 0; color: var(--sp-muted); font-size: 13px; }
.sp-eyebrow { font-size: 10px; letter-spacing: .16em; font-weight: 700; color: #db9994; text-transform: uppercase; }
.sp-head-actions { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.sp-start { display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--sp-muted); }
.sp-start input { min-height: 40px; }
.sp-back { background: none; border: 0; color: var(--sp-muted); font: inherit; font-size: 12px; cursor: pointer; padding: 0 0 8px; display: block; }
.sp-back:hover { color: #fff; }
.sp-message { padding: 10px 14px; border-radius: 8px; background: rgba(127,211,164,.12); color: var(--sp-ok); margin: 0 0 14px; font-size: 13px; }
.sp-message.is-error { background: rgba(255,138,138,.12); color: var(--sp-bad); }
.sp-bad { color: var(--sp-bad); }
.sp-empty { padding: 26px; border: 1px dashed var(--sp-line); border-radius: 12px; color: var(--sp-muted); }
.sp-hint { color: var(--sp-muted); font-size: 12px; line-height: 1.5; margin: 10px 0 0; }
.sp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.sp-card { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 14px; border: 1px solid var(--sp-line); background: var(--sp-soft); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, transform .15s; }
.sp-card:hover, .sp-card:focus-visible { border-color: rgba(219,153,148,.6); transform: translateY(-1px); outline: none; }
.sp-card strong { font-size: 18px; }
.sp-card-site { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--sp-muted); }
.sp-card-dates, .sp-card-meta { font-size: 12px; color: var(--sp-muted); font-variant-numeric: tabular-nums; }
.sp-card-meta b { color: #fff; }
.sp-progress { display: block; height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); overflow: hidden; }
.sp-progress i { display: block; height: 100%; background: linear-gradient(90deg, #db9994, #e86a5f); border-radius: 99px; }
.sp-progress.big { height: 8px; margin-bottom: 16px; }
.sp-pill { align-self: flex-start; font-size: 11px; padding: 4px 9px; border-radius: 99px; background: rgba(255,255,255,.08); color: #ddd; }
.sp-pill.is-bad { background: rgba(255,138,138,.15); color: var(--sp-bad); }
.sp-pill.is-warn { background: rgba(245,184,98,.15); color: var(--sp-warn); }
.sp-pill.is-ok { background: rgba(127,211,164,.13); color: var(--sp-ok); }
.sp-tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 1px solid var(--sp-line); margin-bottom: 16px; }
.sp-tabs button { background: none; border: 0; border-bottom: 3px solid transparent; color: var(--sp-muted); font: inherit; font-size: 13px; font-weight: 600; padding: 10px 14px; cursor: pointer; }
.sp-tabs button.is-active { color: #fff; border-bottom-color: #e86a5f; }
.sp-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 11px; color: var(--sp-muted); margin-bottom: 10px; }
.sp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sp-legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.sp-legend-today i { width: 2px; height: 12px; background: #e86a5f; border-radius: 0; }
.sp-scroll { overflow-x: auto; border: 1px solid var(--sp-line); border-radius: 12px; }
.sp-gantt { position: relative; display: grid; grid-template-columns: var(--lw) repeat(var(--nd), var(--dw)); min-width: max-content; font-size: 12px;
  background-image: linear-gradient(to right, rgba(255,255,255,.05) 1px, transparent 1px); background-size: var(--gw) 100%; background-position: var(--lw) 0; }
.sp-gcorner, .sp-gm { position: sticky; top: 0; background: #1b1b20; color: var(--sp-muted); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; padding: 8px 6px; border-bottom: 1px solid var(--sp-line); white-space: nowrap; overflow: hidden; border-left: 1px solid var(--sp-line); }
.sp-gcorner { left: 0; z-index: 3; border-left: 0; }
.sp-gl { grid-column: 1; position: sticky; left: 0; z-index: 2; background: #17171b; border-right: 1px solid var(--sp-line); border-top: 1px solid rgba(255,255,255,.04); padding: 6px 10px; display: flex; gap: 8px; align-items: baseline; line-height: 1.3; }
.sp-gl b { flex: none; width: 2.2em; color: var(--sp-muted); font-weight: 600; }
.sp-gl span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp-gl.is-break { color: var(--sp-muted); font-style: italic; }
.sp-gb { position: relative; align-self: center; height: 24px; margin: 6px 0; border: 0; border-radius: 5px; padding: 0; cursor: pointer; overflow: visible;
  background: color-mix(in srgb, var(--c) 38%, transparent); font: inherit; }
.sp-gb i { position: absolute; inset: 0 auto 0 0; width: var(--p); background: var(--c); border-radius: 5px; }
.sp-gb em { position: relative; font-style: normal; font-size: 10px; color: #fff; padding: 0 6px; line-height: 24px; white-space: nowrap; text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.sp-gb:hover, .sp-gb:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
.sp-gb.sp-st-done { opacity: .7; }
.sp-gb.sp-st-blocked { outline: 2px solid var(--sp-bad); }
.sp-gb.is-break { background: repeating-linear-gradient(135deg, rgba(255,255,255,.25) 0 6px, transparent 6px 11px); }
.sp-gb.is-break i { display: none; }
.sp-today { position: absolute; top: 0; bottom: 0; width: 2px; background: #e86a5f; z-index: 1; pointer-events: none; }
.sp-toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.sp-toolbar input[type=search] { min-width: min(260px, 100%); flex: 1; }
.sp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.sp-chip { background: var(--sp-soft); border: 1px solid var(--sp-line); color: #ddd; border-radius: 99px; padding: 6px 12px; font: inherit; font-size: 12px; cursor: pointer; }
.sp-chip b { opacity: .6; margin-left: 4px; }
.sp-chip.is-on { background: #e86a5f; border-color: #e86a5f; color: #fff; }
.sp-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 860px; }
.sp-table th { text-align: left; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--sp-muted); padding: 10px; background: rgba(255,255,255,.03); border-bottom: 1px solid var(--sp-line); }
.sp-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,.05); vertical-align: top; }
.sp-table td small { display: block; color: var(--sp-muted); font-size: 11px; margin-top: 2px; }
.sp-table td small.sp-note { color: var(--sp-warn); }
.sp-table select, .sp-table input { min-height: 34px; padding: 4px 8px; font-size: 12px; }
.sp-table input[type=number] { width: 70px; }
.sp-table tr.is-done td { opacity: .6; }
.sp-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sp-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 7px; }
.sp-icon { min-height: 32px; padding: 4px 10px; }
.sp-month { margin-bottom: 18px; }
.sp-month h3 { font-size: 15px; margin: 0 0 8px; display: flex; align-items: baseline; gap: 8px; }
.sp-month h3 span { font-size: 11px; color: var(--sp-muted); font-weight: 400; }
.sp-mat tr.sp-ms-overdue td:first-child b { color: var(--sp-bad); }
.sp-mat tr.sp-ms-overdue td:first-child { box-shadow: inset 3px 0 var(--sp-bad); }
.sp-mat tr.sp-ms-soon td:first-child b { color: var(--sp-warn); }
.sp-mat tr.sp-ms-soon td:first-child { box-shadow: inset 3px 0 var(--sp-warn); }
.sp-mat tr.sp-ms-ordered td:first-child b { color: #9ec5ff; }
.sp-mat tr.sp-ms-delivered td { opacity: .6; }
.sp-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.sp-log li { padding: 8px 10px; border-bottom: 1px solid rgba(255,255,255,.05); }
.sp-log small { color: var(--sp-muted); margin-left: 6px; }
#sp-dialog { border: 0; border-radius: 14px; padding: 22px; width: min(680px, calc(100vw - 32px)); max-height: 90vh; overflow: auto; background: #1d1d22; color: #f2f2f4; box-shadow: 0 24px 80px rgba(0,0,0,.6); }
#sp-dialog::backdrop { background: rgba(0,0,0,.55); }
#sp-dialog h2 { margin: 0; font-size: 19px; }
.sp-dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
#sp-dialog label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--sp-muted, #b8b8bd); margin-bottom: 10px; }
#sp-dialog input, #sp-dialog select, #sp-dialog textarea { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; }
#sp-dialog label.sp-check { flex-direction: row; align-items: center; gap: 8px; }
#sp-dialog label.sp-check input { width: auto; }
.sp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.sp-wide { grid-column: 1 / -1; }
.sp-dialog-actions { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
#sp-dialog-error { color: #ff8a8a; font-size: 13px; min-height: 1em; }
@media (max-width: 720px) { #view-siteplans { --lw: 150px; } .sp-form-grid { grid-template-columns: 1fr; } .sp-head h2 { font-size: 23px; } }

/* ---------- Kostenplanung (nur Administration) ---------- */
.sp-cost-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.sp-subnav { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--sp-line); border-radius: 10px; background: var(--sp-soft); flex-wrap: wrap; }
.sp-subnav button { background: none; border: 0; color: var(--sp-muted); font: inherit; font-size: 13px; font-weight: 600; padding: 7px 14px; border-radius: 7px; cursor: pointer; }
.sp-subnav button.is-active { background: rgba(255,255,255,.10); color: #fff; }
.sp-subnav button:focus-visible, .sp-link:focus-visible, .sp-offer:focus-visible { outline: 2px solid #e86a5f; outline-offset: 2px; }
.sp-cost-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-cost-foot { margin-top: 18px; }
.sp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 16px; }
.sp-kpi { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--sp-line); border-radius: 14px; background: var(--sp-soft); min-width: 0; }
.sp-kpi-label { font-size: 12px; color: var(--sp-muted); }
.sp-kpi strong { font-size: 24px; font-weight: 650; letter-spacing: -.3px; color: #fff; overflow-wrap: anywhere; }
.sp-kpi strong em { font-style: normal; font-size: 14px; font-weight: 600; margin-left: 6px; }
.sp-kpi small { font-size: 12px; color: var(--sp-muted); font-variant-numeric: tabular-nums; }
.sp-kpi.is-good strong { color: var(--sp-ok); }
.sp-kpi.is-bad strong { color: var(--sp-bad); }
.sp-link { background: none; border: 0; padding: 0; color: #f0a39c; font: inherit; font-size: 12px; text-decoration: underline; cursor: pointer; text-align: left; }
.sp-warnings { list-style: none; margin: 0 0 16px; padding: 12px 14px; border: 1px solid rgba(245,184,98,.35); border-radius: 12px; background: rgba(245,184,98,.07); display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.sp-warnings li b { color: var(--sp-warn); font-variant-numeric: tabular-nums; }
.sp-warnings .sp-link { margin-left: 6px; }
.sp-ledger { min-width: 640px; margin: 0; }
.sp-ledger tfoot td, .sp-cost-table tfoot td, .sp-labor-table tfoot td, .sp-month-table tfoot td { border-top: 1px solid var(--sp-line); font-weight: 600; padding: 10px; }
.sp-ledger tr.is-good td { color: var(--sp-ok); }
.sp-ledger tr.is-bad td { color: var(--sp-bad); }
.sp-scroll + .sp-chart-card, .sp-chart-card + .sp-scroll, .sp-scroll + .sp-scroll { margin-top: 16px; }
.sp-chart-card { background: #171717; border: 1px solid var(--sp-line); border-radius: 14px; padding: 16px 16px 10px; }
.sp-chart-head h3 { margin: 0; font-size: 16px; }
.sp-chart-head p { margin: 4px 0 10px; color: var(--sp-muted); font-size: 12px; }
.sp-legend-c { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 12px; color: #c3c2b7; margin-bottom: 8px; }
.sp-legend-c > span { display: inline-flex; align-items: center; gap: 6px; }
.sp-legend-c i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; background: var(--c); }
.sp-legend-c b { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.sp-chart-wrap { position: relative; height: 300px; }
.sp-month-table { min-width: 760px; }
.sp-cost-table { min-width: 900px; }
.sp-cost-table input[type=number] { width: 96px; }
.sp-cost-table tr.sp-group td { background: rgba(255,255,255,.03); font-weight: 600; font-size: 12px; }
.sp-cost-table tr.is-muted td, .sp-labor-table tr.is-muted td, .sp-basis-table tr.is-muted td { opacity: .55; }
.sp-note-plain { color: var(--sp-muted) !important; }
.sp-src a { color: #f0a39c; }
.sp-kind { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 99px; background: rgba(255,255,255,.08); color: #ddd; margin: 0 4px 2px 0; }
.sp-kind-web { background: rgba(57,135,229,.18); color: #9ec5f4; }
.sp-kind-quote, .sp-kind-invoice { background: rgba(127,211,164,.15); color: var(--sp-ok); }
.sp-kind-estimate { background: rgba(255,255,255,.08); color: #c3c2b7; }
.sp-kind-stale { background: rgba(245,184,98,.15); color: var(--sp-warn); }
.sp-actions-cell { white-space: nowrap; text-align: right; }
.sp-bulk { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 12px; border-radius: 10px; background: rgba(57,135,229,.10); font-size: 13px; }
.sp-info { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 14px; border: 1px solid var(--sp-line); border-radius: 12px; background: var(--sp-soft); font-size: 13px; }
.sp-info b { font-size: 16px; color: #fff; margin-left: 6px; }
.sp-info small { display: block; color: var(--sp-muted); margin-top: 3px; }
.sp-labor-table { min-width: 1240px; }
.sp-labor-table input[type=number] { width: 78px; }
.sp-subwrap { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.sp-subwrap input[type=number] { width: 84px !important; }
.sp-subwrap input:not([type=number]) { width: 54px; }
.sp-subwrap span { color: var(--sp-muted); font-size: 12px; }
.sp-labor-table select { min-width: 190px; }
.sp-research { margin-top: 12px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 6px; }
.sp-research small { color: var(--sp-muted); font-size: 11px; }
.sp-rs-result p { margin: 6px 0; font-size: 13px; }
.sp-offers { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-offers li { display: flex; gap: 8px; align-items: stretch; }
.sp-offers a { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--sp-line, rgba(255,255,255,.1)); border-radius: 8px; color: #f0a39c; text-decoration: none; }
.sp-offer { flex: 1; text-align: left; background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.1); border-radius: 8px; color: inherit; font: inherit; font-size: 13px; padding: 8px 10px; cursor: pointer; }
.sp-offer:hover { border-color: rgba(232,106,95,.6); }
.sp-offer small { display: block; color: #b8b8bd; font-size: 11px; margin-top: 2px; }
#sp-dialog .sp-wide { grid-column: 1 / -1; }
#sp-dialog label small { color: #8f8f96; font-size: 11px; }
.sp-dlg-sub { margin: 12px 0 6px; font-size: 13px; color: #fff; }
.sp-mini { min-width: 0; }
.sp-settings section, .sp-basis { border: 1px solid var(--sp-line); border-radius: 14px; padding: 16px; margin-bottom: 16px; background: var(--sp-soft); }
.sp-settings h3, .sp-basis h3 { margin: 0 0 10px; font-size: 16px; }
.sp-settings label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--sp-muted); margin-bottom: 10px; }
.sp-settings label small { font-size: 11px; color: #8f8f96; }
.sp-settings input, .sp-settings select { width: 100%; box-sizing: border-box; }
.sp-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-other-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 0.7fr auto; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.05); }
.sp-other-row label { margin-bottom: 0; }
.sp-other-row .sp-icon { margin-bottom: 2px; }
.sp-basis-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.sp-kpi-inline { text-align: right; }
.sp-kpi-inline b { font-size: 22px; color: #fff; display: block; }
.sp-kpi-inline small { color: var(--sp-muted); font-size: 12px; }
.sp-team-rates { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: #c3c2b7; margin: 6px 0 12px; }
.sp-basis-table { min-width: 640px; }
.sp-basis-table input[type=checkbox] { width: 18px; height: 18px; }
@media (max-width: 900px) {
  .sp-grid-3 { grid-template-columns: 1fr 1fr; }
  .sp-other-row { grid-template-columns: 1fr 1fr; }
  .sp-other-row label:first-child { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .sp-kpis { grid-template-columns: 1fr 1fr; gap: 8px; }
  .sp-kpi { padding: 12px; }
  .sp-kpi strong { font-size: 18px; }
  .sp-grid-3 { grid-template-columns: 1fr; }
  .sp-chart-wrap { height: 240px; }
  .sp-cost-actions .btn { flex: 1; }
}
/* Druck: nur der Kostenplan, auf weißem Papier lesbar */
@media print {
  body.sp-print * { visibility: hidden !important; }
  body.sp-print #view-siteplans, body.sp-print #view-siteplans * { visibility: visible !important; }
  body.sp-print #view-siteplans { position: absolute; left: 0; top: 0; width: 100%; padding: 0; margin: 0; }
  body.sp-print .sp-tabs, body.sp-print .sp-subnav, body.sp-print .sp-cost-actions, body.sp-print .sp-head-actions, body.sp-print .sp-back,
  body.sp-print .sp-warnings button, body.sp-print .sp-progress.big, body.sp-print #sp-message { display: none !important; }
  body.sp-print, body.sp-print #view-siteplans, body.sp-print #view-siteplans * { color: #111 !important; background: transparent !important; border-color: #ccc !important; box-shadow: none !important; }
  body.sp-print .sp-legend-c i { background: var(--c) !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body.sp-print .sp-scroll { overflow: visible; }
  body.sp-print .sp-table { min-width: 0; font-size: 11px; }
  body.sp-print .sp-chart-card, body.sp-print .sp-scroll, body.sp-print .sp-kpis { break-inside: avoid; }
}
/* Monats- und Link-Felder im gleichen dunklen Stil wie die übrigen Eingaben der App */
.sp-settings input[type=month], #sp-dialog input[type=url] { background: #262626 !important; border: 1px solid #ffffff !important; color: #e5e7eb !important;
  border-radius: 8px !important; padding: 10px 12px !important; font-size: 0.9rem !important; color-scheme: dark; }
.sp-settings input::placeholder { color: #8f8f96 !important; opacity: 1; }

/* ---------- Pläne (Projektzeichnungen als PDF) ---------- */
.sp-doc-upload { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; padding: 16px; margin-bottom: 16px; border: 1px dashed rgba(255,255,255,.22); border-radius: 14px; background: var(--sp-soft); }
.sp-doc-upload.is-over { border-color: #e86a5f; background: rgba(232,106,95,.08); }
.sp-doc-upload-text { flex: 1 1 260px; display: flex; flex-direction: column; gap: 4px; }
.sp-doc-upload-text small { color: var(--sp-muted); font-size: 12px; }
.sp-doc-cat-pick { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--sp-muted); min-width: 220px; }
.sp-doc-pick { cursor: pointer; }
.sp-doc-progress { flex-basis: 100%; font-size: 12px; color: #9ec5f4; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sp-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.sp-doc { display: flex; flex-direction: column; border: 1px solid var(--sp-line); border-radius: 14px; overflow: hidden; background: var(--sp-soft); min-width: 0; }
.sp-doc-open { display: block; position: relative; aspect-ratio: 1.414 / 1; background: #f4f4f2; overflow: hidden; }
.sp-doc-open:focus-visible { outline: 2px solid #e86a5f; outline-offset: -2px; }
.sp-doc-open img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; }
.sp-doc-ph { display: flex; align-items: center; justify-content: center; height: 100%; font-size: 42px; color: #c0392b; }
.sp-doc-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; }
.sp-doc-cat { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #db9994; font-weight: 700; }
.sp-doc-body b { font-size: 14px; overflow-wrap: anywhere; }
.sp-doc-body small { color: var(--sp-muted); font-size: 12px; }
.sp-doc-actions { display: flex; gap: 6px; margin-top: 4px; }
.sp-doc-actions .btn { min-height: 34px; padding: 6px 12px; font-size: 12px; text-decoration: none; }
.sp-doc-links { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.sp-doc-links span { font-size: 12px; color: var(--sp-muted); }
.sp-doc-links a { color: #f0a39c; font-size: 13px; text-decoration: none; overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .sp-docs { grid-template-columns: 1fr 1fr; gap: 10px; }
  .sp-doc-body { padding: 10px; }
  .sp-doc-actions .btn:not(.sp-icon) { flex: 1; }
  .sp-doc-cat-pick { min-width: 0; flex: 1 1 100%; }
}

/* Zeitplan in Arbeitstagen: Kopfzeilen Monat / Woche / Tag, Meilensteine, Ziehen, Personalbedarf */
.sp-gw, .sp-gd { position: sticky; background: #1b1b20; color: var(--sp-muted); font-size: 10px; border-bottom: 1px solid var(--sp-line); border-left: 1px solid var(--sp-line); white-space: nowrap; overflow: hidden; z-index: 1; }
.sp-gm { z-index: 1; }
.sp-gcorner.sp-gh2, .sp-gw { top: 29px; padding: 4px 6px; }
.sp-gcorner.sp-gh3, .sp-gd { top: 51px; padding: 3px 0; }
.sp-gcorner.sp-gh2, .sp-gcorner.sp-gh3 { z-index: 3; }
.sp-gd { display: flex; flex-direction: column; align-items: center; line-height: 1.15; font-size: 9px; }
.sp-gd b { font-size: 11px; color: #e6e6ea; font-weight: 600; }
.sp-gd.is-today { background: rgba(232,106,95,.25); }
.sp-gb-grip { position: absolute; top: 0; right: 0; bottom: 0; width: 8px; cursor: ew-resize; border-radius: 0 5px 5px 0; }
.sp-gb:hover .sp-gb-grip { background: rgba(255,255,255,.35); }
.sp-gb.has-deps::before { content: ''; position: absolute; left: -4px; top: 50%; width: 0; height: 0; border: 4px solid transparent; border-left-color: rgba(255,255,255,.55); transform: translate(-2px, -50%); }
.sp-gb.is-drag, .sp-gms.is-drag { outline: 2px dashed #fff; outline-offset: 1px; cursor: grabbing; z-index: 2; }
.is-day .sp-gb, .is-week .sp-gb { cursor: grab; }
.sp-drag-tip { position: absolute; left: 0; bottom: calc(100% + 4px); background: #0d0d0d; color: #fff; font-size: 11px; padding: 3px 7px; border-radius: 5px; white-space: nowrap; pointer-events: none; z-index: 5; }
.sp-gms { position: relative; align-self: center; justify-self: center; width: 100%; height: 24px; margin: 6px 0; border: 0; padding: 0; background: none; cursor: pointer; overflow: visible; font: inherit; }
.sp-gms i { position: absolute; left: 50%; top: 50%; width: 13px; height: 13px; background: var(--c); transform: translate(-50%, -50%) rotate(45deg); border: 2px solid #fff; border-radius: 2px; }
.sp-gms em { position: absolute; left: calc(50% + 12px); top: 50%; transform: translateY(-50%); font-style: normal; font-size: 10px; color: #e6e6ea; white-space: nowrap; }
.sp-gms.sp-st-done i { opacity: .6; }
.sp-gms:hover i, .sp-gms:focus-visible i { outline: 2px solid #fff; outline-offset: 2px; }
.sp-legend-ms i { width: 9px; height: 9px; background: #c3c2b7; transform: rotate(45deg); border-radius: 1px; }
.sp-zoom { margin-left: auto; display: inline-flex; border: 1px solid var(--sp-line); border-radius: 8px; overflow: hidden; }
.sp-zoom button { background: none; border: 0; color: var(--sp-muted); font: inherit; font-size: 11px; padding: 4px 10px; cursor: pointer; }
.sp-zoom button.is-on { background: rgba(255,255,255,.12); color: #fff; }
.sp-gl-staff { border-top: 1px solid var(--sp-line); color: var(--sp-muted); }
.sp-gl-staff small { color: #8f8f96; }
.sp-gs { align-self: stretch; display: flex; align-items: center; justify-content: center; font-size: 10px; font-variant-numeric: tabular-nums; border-top: 1px solid var(--sp-line); color: #e6e6ea; min-height: 28px; }
.sp-gs.is-ok { background: rgba(127,211,164,.14); }
.sp-gs.is-high { background: rgba(245,184,98,.22); }
.sp-gs.is-over { background: rgba(255,138,138,.3); color: #fff; font-weight: 700; }
.sp-overlaps { margin-top: 16px; padding: 14px 16px; border: 1px solid rgba(245,184,98,.35); border-radius: 12px; background: rgba(245,184,98,.06); }
.sp-overlaps h3 { margin: 0 0 8px; font-size: 14px; color: var(--sp-warn); }
.sp-overlaps ul, .sp-ai ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.55; }
.sp-overlaps li { margin-bottom: 4px; }
.sp-code { padding: 1px 7px !important; font-size: 11px !important; margin-right: 3px; font-variant-numeric: tabular-nums; }
.sp-ms-icon { color: #c3c2b7; font-size: 10px; }
.sp-note-plain { display: block; color: var(--sp-muted); font-size: 11px; margin-top: 3px; }
.sp-info-list { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; font-size: 13px; margin: 8px 0; }
.sp-info-list dt { color: var(--sp-muted); }
.sp-info-list dd { margin: 0; }
.sp-deps { font-size: 12px; color: var(--sp-muted); border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; padding-top: 8px; }
.sp-deps p { margin: 0 0 4px; }
.sp-deps b { color: #fff; }
#sp-dialog fieldset.sp-people { border: 1px solid var(--sp-line, rgba(255,255,255,.1)); border-radius: 10px; padding: 8px 10px; margin: 0 0 10px; }
#sp-dialog fieldset.sp-people legend { font-size: 12px; color: var(--sp-muted, #b8b8bd); padding: 0 4px; }
.sp-people-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 10px; max-height: 180px; overflow: auto; }
#sp-dialog label.sp-person { flex-direction: row; align-items: center; gap: 6px; margin: 0; font-size: 13px; color: #e6e6ea; }
#sp-dialog label.sp-person input { width: auto; }
#sp-dialog label.sp-person small { color: #8f8f96; }
/* Entwurf und KI-Hinweise */
.sp-pill.is-draft { background: rgba(158,197,244,.15); color: #9ec5f4; }
.sp-card.is-draft { border-style: dashed; }
.sp-draft-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin: 0 0 14px; border-radius: 12px; background: rgba(158,197,244,.10); border: 1px solid rgba(158,197,244,.3); font-size: 13px; }
.sp-ai { margin: 0 0 14px; border: 1px solid rgba(219,153,148,.35); border-radius: 12px; background: rgba(219,153,148,.05); padding: 0 16px; }
.sp-ai summary { cursor: pointer; padding: 12px 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; list-style: none; }
.sp-ai summary::-webkit-details-marker { display: none; }
.sp-ai summary i { color: #db9994; }
.sp-ai[open] summary { border-bottom: 1px solid rgba(255,255,255,.08); }
.sp-ai-sum { font-size: 14px; line-height: 1.5; margin: 12px 0 0; }
.sp-ai-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 22px; margin: 12px 0 0; }
.sp-ai-grid h4 { margin: 0 0 6px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--sp-muted); }
.sp-ai-grid section > h4 + p { margin-top: 0; }
.sp-ai-meta { padding-bottom: 12px; }
.sp-warn-text { color: var(--sp-warn) !important; }
.sp-muted-text { color: var(--sp-muted); }
.sp-warn-box { display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; margin: 0 0 14px; border-radius: 10px; background: rgba(245,184,98,.10); color: var(--sp-warn); font-size: 13px; }
/* Assistent „Neuer Plan“ */
.sp-wiz { display: flex; flex-direction: column; gap: 16px; }
.sp-wiz-step { border: 1px solid var(--sp-line); border-radius: 14px; padding: 16px 18px; background: var(--sp-soft); }
.sp-wiz-step h3 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 16px; }
.sp-step { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: #db9994; color: #1b1b20; font-size: 13px; font-weight: 700; flex: none; }
.sp-wiz-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--sp-muted); margin-bottom: 10px; }
.sp-wiz-grid input, .sp-wiz-grid select, .sp-wiz-desc, .sp-wdocs select { width: 100%; box-sizing: border-box; font: inherit; font-size: 14px; min-height: 40px; }
.sp-wiz-desc { min-height: 110px; resize: vertical; }
.sp-wiz-drop { margin-bottom: 10px; }
.sp-wdocs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sp-wdocs li { display: grid; grid-template-columns: 24px 1fr minmax(150px, 220px) 40px; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--sp-line); border-radius: 10px; }
.sp-wdocs li > i { color: #db9994; font-size: 18px; }
.sp-wdoc-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-wdoc-main b { overflow-wrap: anywhere; font-size: 13px; }
.sp-wdoc-main small { font-size: 11px; color: var(--sp-muted); overflow-wrap: anywhere; }
.sp-offers { display: flex; flex-direction: column; gap: 6px; max-height: 460px; overflow: auto; }
.sp-offer { border: 1px solid var(--sp-line); border-radius: 10px; padding: 8px 12px; }
.sp-offer.is-on { border-color: rgba(219,153,148,.7); background: rgba(219,153,148,.07); }
.sp-offer-row { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.sp-offer-row input { margin-top: 3px; width: auto; flex: none; }
.sp-offer-main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; font-size: 13px; }
.sp-offer-main small { flex-basis: 100%; font-size: 12px; overflow-wrap: anywhere; }
.sp-offer-sum { font-weight: 600; white-space: nowrap; }
.sp-offer .sp-link { margin: 4px 0 0 26px; font-size: 12px; }
.sp-offer-items { font-size: 12px; margin-top: 6px; }
.sp-offer-items small { display: block; color: var(--sp-muted); }
.sp-wiz-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.sp-wiz-alt { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sp-wiz-alt select { min-height: 40px; max-width: 260px; }
.sp-wiz-spacer { flex: 1; }
.sp-ai-btn { min-height: 46px; font-size: 15px; }
.sp-ai-btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.sp-danger { color: var(--sp-bad); }
.sp-wiz-run { border: 1px solid rgba(219,153,148,.5); border-radius: 14px; padding: 16px 18px; background: rgba(219,153,148,.07); }
.sp-wiz-run.is-failed { border-color: rgba(255,138,138,.5); background: rgba(255,138,138,.07); }
.sp-run-head { display: flex; align-items: center; gap: 10px; font-size: 15px; }
.sp-run-head i { color: #db9994; }
.sp-run-steps { margin: 12px 0 0; padding-left: 20px; font-size: 13px; color: var(--sp-muted); line-height: 1.8; }
.sp-run-steps li.is-done { color: var(--sp-ok); }
.sp-run-steps li.is-done::after { content: ' ✓'; }
.sp-run-steps li.is-active { color: #fff; font-weight: 600; }
.sp-pulse { animation: sp-pulse 1.4s ease-in-out infinite; }
@keyframes sp-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .sp-pulse { animation: none; } }
.sp-doc-ph { flex-direction: column; gap: 6px; color: #8a5a55; }
.sp-doc-ph small { font-size: 12px; font-weight: 700; letter-spacing: .1em; color: #6b6b70; }
@media (max-width: 720px) {
  .sp-wdocs li { grid-template-columns: 22px 1fr 40px; }
  .sp-wdocs li select { grid-column: 2 / 4; }
  .sp-wiz-step { padding: 14px; }
  .sp-wiz-actions .btn, .sp-wiz-alt { width: 100%; }
  .sp-wiz-alt select { max-width: none; flex: 1; }
  .sp-wiz-spacer { display: none; }
  .sp-zoom { margin-left: 0; }
}
.sp-gl b { width: auto; min-width: 2.2em; }
#sp-dialog label.sp-person input { flex: none; }
#sp-dialog label.sp-person span { min-width: 0; overflow-wrap: anywhere; }
.sp-ai-grid section h4:not(:first-child) { margin-top: 12px; }

/* Leistung und Abrechnung je Gewerk */
.sp-tb h3 { margin: 6px 0 4px; font-size: 15px; }
.sp-tb-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; margin-top: 12px; }
.sp-tb-row { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border: 1px solid var(--sp-line); border-radius: 14px; background: var(--sp-soft); min-width: 0; }
.sp-tb-row header { display: flex; justify-content: space-between; align-items: baseline; gap: 6px 12px; flex-wrap: wrap; }
.sp-tb-row header span { font-size: 12px; color: var(--sp-muted); font-variant-numeric: tabular-nums; }
.sp-tb-bars { display: grid; grid-template-columns: max-content minmax(0, 1fr) max-content; align-items: center; gap: 8px 10px; font-size: 12px; color: var(--sp-muted); }
.sp-tb-bars b { color: #fff; text-align: right; font-variant-numeric: tabular-nums; }
.sp-progress.is-billed i { background: linear-gradient(90deg, #9cc3e6, #5b9bd5); }
.sp-tb-row p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--sp-muted); overflow-wrap: anywhere; }
.sp-ok-text { color: var(--sp-ok); }

/* Follow the entire schedule row, including empty dates and the pinned task name. */
.sp-grow { display: grid; grid-column: 1 / -1; grid-template-columns: var(--lw) repeat(var(--nd), var(--dw)); min-width: 0; }
@media (hover: hover) {
  .sp-grow:hover { background-color: rgba(232,106,95,.12); box-shadow: inset 0 1px rgba(232,106,95,.32), inset 0 -1px rgba(232,106,95,.32); }
  .sp-grow:hover > .sp-gl { background-color: #352629; box-shadow: inset 3px 0 #ed8e83; }
  .sp-grow:hover > .sp-gl b { color: #ffd2cc; }
}
.sp-grow:has(:focus-visible) { background-color: rgba(232,106,95,.12); box-shadow: inset 0 1px rgba(232,106,95,.32), inset 0 -1px rgba(232,106,95,.32); }
.sp-grow:has(:focus-visible) > .sp-gl { background-color: #352629; box-shadow: inset 3px 0 #ed8e83; }
.sp-grow:has(:focus-visible) > .sp-gl b { color: #ffd2cc; }
