:root {
  --bg: #f5f6f8; --karte: #fff; --text: #1d232b; --leise: #6b7480; --rand: #dde1e6;
  --akzent: #1f5fa8; --akzent-dunkel: #174a85; --orange: #f39a3e; --orange-dunkel: #d35a1a;
  --gefahr: #b3261e; --we: rgba(0,0,0,.045); --ok: #2e7d32; --warn: #a15c00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #15181c; --karte: #1f242a; --text: #e6e9ed; --leise: #98a1ac; --rand: #343b44;
          --akzent: #6ea8e6; --akzent-dunkel: #8dbcf0; --orange: #f5a75a; --orange-dunkel: #f08a4b; --gefahr: #f2867e; --we: rgba(255,255,255,.04); --ok: #7cc47f; --warn: #e0a85a; }
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1400px; margin: 0 auto; padding: 16px; }
h1 { font-size: 1.5rem; margin: .3em 0 .6em; color: var(--akzent); }
h2 { font-size: 1.15rem; margin: 1.2em 0 .5em; padding-left: 8px; border-left: 4px solid var(--orange); }

.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; padding: 8px 16px;
       background: var(--karte); border-bottom: 4px solid var(--orange); }
.logo { display: flex; align-items: center; }
.logo img { height: 58px; width: auto; display: block; }
.logo-gross { display: block; width: 100%; max-width: 320px; margin: 0 auto 18px; }
@media (prefers-color-scheme: dark) {
  .logo img, .logo-gross { background: #fff; border-radius: 6px; padding: 3px 6px; }
}
.top nav { display: flex; flex-wrap: wrap; gap: 4px; }
.top nav a { padding: 6px 10px; border-radius: 6px; color: var(--text); font-weight: 500; }
.top nav a:hover { text-decoration: none; background: var(--we); }
.top nav a.aktiv { background: var(--akzent); color: #fff; box-shadow: inset 0 -3px 0 var(--orange); }

.karte { background: var(--karte); border: 1px solid var(--rand); border-radius: 10px; padding: 14px; margin: 0 0 16px; }
details.karte > summary { cursor: pointer; }
details.karte[open] > summary { margin-bottom: 10px; }

input, select, textarea, button { font: inherit; color: inherit; }
input, select, textarea { padding: 7px 9px; border: 1px solid var(--rand); border-radius: 6px; background: var(--bg); max-width: 100%; }
button, .btn { padding: 7px 14px; border: 0; border-radius: 6px; background: var(--akzent); color: #fff; cursor: pointer; display: inline-block; }
button:hover { background: var(--akzent-dunkel); }
button.orange, .btn.orange { background: var(--orange-dunkel); color: #fff; border-color: var(--orange-dunkel); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: var(--orange); }
.btn { background: var(--karte); color: var(--text); border: 1px solid var(--rand); }
.btn.aktiv { background: var(--akzent); color: #fff; border-color: var(--akzent); }
.btn:hover { text-decoration: none; }
button.zweit, button.zweit:hover { background: var(--karte); color: var(--text); border: 1px solid var(--rand); }
button.gefahr, button.gefahr:hover { background: transparent; color: var(--gefahr); border: 1px solid var(--gefahr); }
button.klein { padding: 3px 8px; font-size: .85em; }

.formular label { display: flex; flex-direction: column; gap: 3px; font-size: .9em; color: var(--leise); margin-bottom: 10px; }
.formular label input, .formular label select, .formular label textarea { color: var(--text); width: 100%; }
.raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0 14px; }
.raster .breit { grid-column: 1 / -1; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }

.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.kamera input { display: none; }
.kamera span { display: inline-block; padding: 12px 18px; border: 2px dashed var(--orange); border-radius: 10px; color: var(--orange-dunkel); cursor: pointer; font-weight: 600; }
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filter input[name=q] { flex: 1 1 240px; }

.liste { width: 100%; border-collapse: collapse; background: var(--karte); border: 1px solid var(--rand); border-radius: 10px; overflow: hidden; }
.liste th, .liste td { padding: 8px 10px; border-bottom: 1px solid var(--rand); text-align: left; vertical-align: middle; }
.liste th { font-size: .85em; color: var(--akzent); font-weight: 600; background: var(--we); }
.liste td input, .liste td select { width: 100%; min-width: 70px; }
tr.inaktiv { opacity: .5; }
@media (max-width: 700px) {
  .liste { display: block; overflow-x: auto; }
}

.leise { color: var(--leise); }
.info { background: var(--karte); border-left: 4px solid var(--orange); padding: 8px 12px; border-radius: 6px; }
.warnung { background: var(--karte); border-left: 4px solid var(--gefahr); padding: 8px 12px; border-radius: 6px; }
.status { font-size: .8em; padding: 2px 8px; border-radius: 99px; border: 1px solid currentColor; white-space: nowrap; }
.s-fertig { color: var(--ok); } .s-fehler { color: var(--gefahr); } .s-wartet, .s-laeuft { color: var(--warn); }
.tag { font-size: .75em; padding: 1px 6px; border-radius: 4px; background: var(--rand); color: var(--text); }
.tag.sub { background: #e9d8f7; color: #4a2470; }
@media (prefers-color-scheme: dark) { .tag.sub { background: #3d2856; color: #e4cffa; } }
.punkt { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; }
.punkt.gross { width: 16px; height: 16px; }

.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
@media (max-width: 900px) { .zweispaltig { grid-template-columns: 1fr; } }
.vorschau img { width: 100%; border: 1px solid var(--rand); border-radius: 8px; background: #fff; }
.vorschau iframe { width: 100%; height: 75vh; border: 1px solid var(--rand); border-radius: 8px; background: #fff; }
pre.ocr { white-space: pre-wrap; font-size: .8em; background: var(--karte); padding: 10px; border-radius: 8px; border: 1px solid var(--rand); max-height: 400px; overflow: auto; }
.ls-liste { padding-left: 18px; }

/* Board / Zeitstrahl */
.board-kopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.board-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.board { background: var(--karte); border: 1px solid var(--rand); border-radius: 10px; overflow-x: auto; margin: 10px 0; }
.board .zeile { display: flex; min-width: 900px; border-bottom: 1px solid var(--rand); }
.board .name { flex: 0 0 200px; padding: 6px 10px; font-size: .88em; border-right: 1px solid var(--rand); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
               position: sticky; left: 0; background: var(--karte); z-index: 2; }
.board .name small { display: block; }
.board .spur { position: relative; flex: 1; min-height: 34px; }
.board .kw-spur { display: flex; }
.board .kw { font-size: .75em; padding: 4px; border-left: 1px solid var(--rand); color: var(--leise); text-align: center; }
.board .kw small { display: block; }
.board .abschnitt { padding: 6px 10px; font-weight: 600; font-size: .85em; background: var(--bg); border-bottom: 1px solid var(--rand); position: sticky; left: 0; min-width: 900px; }
.board .balken { position: absolute; top: 6px; bottom: 6px; border-radius: 5px; color: #fff; font-size: .78em; padding: 2px 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
                 text-shadow: 0 1px 1px rgba(0,0,0,.35); z-index: 1; }
.board .balken:hover { text-decoration: none; filter: brightness(1.1); }
.board .balken.cut-l { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.board .balken.cut-r { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.board .balken.einsatz { opacity: .92; }
.board .balken.konflikt { outline: 3px solid var(--gefahr); outline-offset: -1px; }
.board .heute { position: absolute; top: 0; bottom: 0; width: 3px; background: var(--orange); opacity: .85; z-index: 0; }
.klein-text { font-size: .8em; position: absolute; top: 8px; left: 8px; }
.seiten { display: flex; gap: 14px; justify-content: center; }
.wer { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.wer form { margin: 0; }
.banner { background: var(--gefahr); color: #fff; padding: 8px 16px; font-weight: 600; }
.schmal { max-width: 380px; margin: 40px auto; }
.haken { flex-direction: row !important; align-items: center; gap: 8px !important; }
.haken input { width: auto !important; }
.raster > .knoepfe { align-self: end; margin-bottom: 10px; }
.upload-liste { flex-basis: 100%; margin: 0; padding-left: 18px; }
.upload-liste li { margin: 4px 0; }
.fehlertext { color: var(--gefahr); }
.klein-hinweis { flex-basis: 100%; font-size: .85em; margin: 0; }

/* Projekte / Status wie im Firmenprogramm */
.titelzeile { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; }
.pill { display: inline-block; font-size: .78em; font-weight: 600; padding: 2px 10px; border-radius: 99px; white-space: nowrap; vertical-align: middle; }
h1 .pill { font-size: .55em; margin-left: 8px; }
.st-erstkontakt { background: #fde1dc; color: #a2321f; }
.st-angebot { background: #dbe7f7; color: #1f5fa8; }
.st-auftrag { background: #d4f0f2; color: #106b73; }
.st-ausfuehrung { background: #fdeeb5; color: #7a5600; }
.st-abgeschlossen { background: #dcefdc; color: #2e6b31; }
.st-intern { background: #e6e0f6; color: #4b3a8c; }
.st-kein { background: #e8eaed; color: #59616b; }
@media (prefers-color-scheme: dark) {
  .st-erstkontakt { background: #5a2a22; color: #ffc2b6; } .st-angebot { background: #1f3a5c; color: #b7d3f5; }
  .st-auftrag { background: #164a4f; color: #a6e6ec; } .st-ausfuehrung { background: #54460f; color: #f7de85; }
  .st-abgeschlossen { background: #24452a; color: #aedcae; } .st-intern { background: #3a3160; color: #d4c9f7; }
  .st-kein { background: #343b44; color: #c2c9d1; }
}
.tabelle-scroll { overflow-x: auto; margin: 10px 0; }
.liste.import td { padding: 4px 5px; }
.liste.import td input, .liste.import td select { min-width: 0; padding: 4px 6px; font-size: .9em; }
.liste.import .schmal-feld { width: 72px; }
.liste.import input[type=date] { width: 135px; }
.liste.import input[type=checkbox] { width: auto; }
.top.ohne-login .logo { display: none; }
.top.ohne-login { min-height: 8px; padding: 0; }
.liste td.nr { white-space: nowrap; }
@media (max-width: 700px) { .logo img { height: 44px; } }
.zeitraum-info { margin: -4px 0 6px; font-size: .85em; min-height: 1.2em; }
select.pill { border: 0; appearance: none; -webkit-appearance: none; cursor: pointer; padding: 3px 22px 3px 10px; font: inherit; font-size: .78em; font-weight: 600;
  background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: right 11px center, right 7px center; background-size: 4px 4px; background-repeat: no-repeat; outline-offset: 1px; }
select.pill:disabled { opacity: .6; }
.liste th a.sortieren { color: inherit; white-space: nowrap; }
.liste th a.sortieren.aktiv { color: var(--orange-dunkel); }
.board .balken.zeitraum { background: color-mix(in srgb, var(--farbe) 22%, transparent); border: 1px dashed var(--farbe); color: var(--text); text-shadow: none; top: 3px; bottom: 3px; z-index: 0; }
.board .balken.belegt { z-index: 1; top: 8px; bottom: 8px; padding-top: 0; padding-bottom: 0; line-height: 18px; }
.board [data-drag] { cursor: grab; touch-action: pan-x pan-y; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.board [data-drag]::before, .board [data-drag]::after { content: ""; position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.board [data-drag]::before { left: 0; } .board [data-drag]::after { right: 0; }
.board [data-drag]:hover::before, .board [data-drag]:hover::after { background: rgba(255,255,255,.35); }
.board .balken.zieht { cursor: grabbing; z-index: 5; box-shadow: 0 4px 14px rgba(0,0,0,.35); filter: brightness(1.08); opacity: 1; }
.board .zeile.ziel .spur { background-color: color-mix(in srgb, var(--orange) 14%, transparent); }
.drag-info { position: fixed; z-index: 50; pointer-events: none; background: var(--text); color: var(--bg); font-size: .8em; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
