:root {
  --grund: #F4F5F8; --flaeche: #FFFFFF; --rand: #DDE0E8; --schrift: #1C1B2E; --schrift2: #5A5878;
  /* Hausfarben Stueber & Lenz GmbH (Logo: Rot #E2000B, Blau #0069B4; Website: Navy #0A1E32, Blau #0090D2, Hellblau #8CA9C7) */
  --akzent: #0069B4; --akzent2: #0090D2; --navy: #0A1E32; --kachel: #1E3A5C; --linie: #365375;
  --hell: #8CA9C7; --weiss: #FFFFFF; --gruen: #2ECC71; --gelb: #F5B335; --rot: #E2000B; --grau: #8E8CA8;
  --feiertag: #F4B6C2; --wochenende: #ECEDF2; --heute: #DDEFFB;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif; font-size: 14px; color: var(--schrift);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grund); }
a { color: var(--akzent); text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--rand); background: var(--flaeche); border-radius: 6px; padding: 6px 12px; }
button:hover { border-color: var(--akzent); }
button.prim { background: var(--akzent); color: #fff; border-color: var(--akzent); }
button.prim:hover { background: #086ea3; }
button.klein { padding: 2px 8px; font-size: 12px; }
button.gefahr { color: var(--rot); }
button:disabled { opacity: .5; cursor: default; }
input, select, textarea { border: 1px solid var(--rand); border-radius: 6px; padding: 6px 8px; background: #fff; }
input:focus, select:focus, textarea:focus { outline: 2px solid #9ad3f0; outline-offset: 0; border-color: var(--akzent); }
input[type=number] { width: 7em; }
table { border-collapse: collapse; width: 100%; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { font-weight: 600; color: var(--schrift2); font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
td.z, th.z { text-align: right; font-variant-numeric: tabular-nums; }
.laden { padding: 40px; color: var(--schrift2); text-align: center; }
.hinweis { color: var(--schrift2); font-size: 13px; }
.fehler { color: var(--rot); }
.ok { color: #1e8f4e; }
.klein { font-size: 12px; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; white-space: pre-wrap; }

/* Kopf + Navigation */
.kopf { background: var(--navy); color: #fff; display: flex; align-items: center; gap: 14px; padding: 8px 16px; flex-wrap: wrap; position: sticky; top: 0; z-index: 20; }
.kopf .marke { font-weight: 700; font-size: 16px; letter-spacing: .01em; }
.kopf .marke span { color: var(--rot); }
.wochentabelle { overflow-x: auto; margin-top: 6px; }
.wochentabelle table { border-collapse: collapse; font-size: 11px; white-space: nowrap; width: auto; }
.wochentabelle th, .wochentabelle td { padding: 2px 6px; text-align: right; border-color: var(--linie); color: var(--hell); }
.wochentabelle th:first-child, .wochentabelle td:first-child { text-align: left; color: #fff; }
.wochentabelle td.erl { color: #fff; }
.kachel:has(.uhr) { display: flex; flex-direction: column; }
.uhr { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.uhr svg { width: 100%; max-width: 260px; display: block; margin: 0 auto; }
.uhr .stand { text-align: center; font-size: 12px; color: var(--hell); margin-top: 2px; }
.uhr .stand b { color: #fff; }
.kopf .projekt { color: var(--hell); }
.kopf nav { display: flex; gap: 4px; flex-wrap: wrap; }
.kopf nav a { color: var(--hell); padding: 6px 10px; border-radius: 6px; }
.kopf nav a.aktiv, .kopf nav a:hover { background: var(--kachel); color: #fff; }
.kopf .rechts { margin-left: auto; display: flex; gap: 8px; align-items: center; color: var(--hell); }
.kopf .rechts button { background: transparent; color: var(--hell); border-color: var(--linie); }
.inhalt { padding: 16px; max-width: 1600px; margin: 0 auto; }
.zeile { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.zeile h1, .zeile h2 { margin: 0; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 14px; margin: 14px 0 6px; color: var(--schrift2); }
.karte { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 10px; padding: 14px 16px; margin-bottom: 14px; }
.karten { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.formular { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; align-items: center; }
.formular label { color: var(--schrift2); }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; background: var(--wochenende); }
.legende { display: flex; gap: 8px; flex-wrap: wrap; }
.legende .chip { border: 1px solid rgba(0,0,0,.08); }
.ampel { display: inline-block; width: 12px; height: 12px; border-radius: 50%; margin-right: 6px; }
.ampel.gruen { background: var(--gruen); } .ampel.gelb { background: var(--gelb); } .ampel.rot { background: var(--rot); } .ampel.grau { background: var(--grau); }

/* Anmeldung */
.anmeldung { max-width: 380px; margin: 60px auto; }
.anmeldung .karte { padding: 24px; }
.anmeldung input { width: 100%; margin-bottom: 10px; }

/* Cockpit */
.cockpit { background: var(--navy); border-radius: 12px; padding: 14px; color: #fff; }
.cockpit .kopf2 { display: flex; align-items: baseline; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.cockpit .kopf2 h1 { font-size: 20px; margin: 0; }
.cockpit .kopf2 .meta { color: var(--hell); font-size: 12px; margin-left: auto; }
.kacheln { display: grid; grid-template-columns: repeat(12, 1fr); gap: 10px; }
.gruppe { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--linie); }
.gruppe:first-of-type { border-top: none; margin-top: 0; padding-top: 0; }
.gruppe-titel { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--hell); margin: 0 0 6px 2px; }
.kachel { background: var(--kachel); border-radius: 10px; padding: 12px 14px; min-height: 120px; grid-column: span 3; }
.kachel.breit { grid-column: span 6; }
.kachel.mittel { grid-column: span 4; }
.kachel .titel { font-weight: 600; font-size: 13px; color: #fff; margin-bottom: 6px; }
.kachel .wert { font-size: 30px; font-weight: 700; line-height: 1.1; color: #fff; margin: 4px 0 8px; font-variant-numeric: tabular-nums; }
.kachel .wert.klein { font-size: 22px; }
.kachel .unter { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; font-size: 12px; color: var(--hell); }
.kachel .unter b { color: #fff; font-weight: 500; font-variant-numeric: tabular-nums; text-align: right; }
.balken { height: 8px; background: var(--linie); border-radius: 4px; overflow: hidden; margin: 4px 0 8px; }
.balken > i { display: block; height: 100%; background: var(--akzent2); border-radius: 4px; }
.balken.zwei { display: flex; }
.balken.zwei > i { border-radius: 0; }
.balken.zwei > i.sub { background: var(--gelb); }
.ampelkachel { border-radius: 8px; padding: 8px 10px; margin-top: 8px; font-weight: 700; color: var(--navy); }
.ampelkachel.gruen { background: var(--gruen); } .ampelkachel.gelb { background: var(--gelb); } .ampelkachel.rot { background: var(--rot); color: #fff; } .ampelkachel.grau { background: var(--grau); }
.kachel table { font-size: 12px; }
.kachel th, .kachel td { border-color: var(--linie); padding: 3px 4px; color: var(--hell); }
.kachel th { color: var(--hell); font-size: 11px; }
.kachel td:first-child { color: #fff; }
.diagramm svg { width: 100%; height: 150px; display: block; }
.diagramm .lg { display: flex; gap: 14px; font-size: 11px; color: var(--hell); justify-content: center; margin-top: 4px; }
.diagramm .lg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: middle; }
.tip { position: fixed; pointer-events: none; background: #0f0d22; color: #fff; padding: 6px 8px; border-radius: 6px; font-size: 12px; z-index: 50; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.3); }
@media (max-width: 1100px) { .kachel, .kachel.mittel { grid-column: span 6; } .kachel.breit { grid-column: span 12; } }
@media (max-width: 640px) { .kachel, .kachel.mittel, .kachel.breit { grid-column: span 12; } }

/* Monatsplan */
.plan-kopf { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 6px; }
.plan-nav { display: flex; gap: 8px; align-items: center; }
.plan-nav h1 { min-width: 200px; margin: 0; text-align: center; }
.plan-legende { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.tag .tk .montfeld.sub { margin-left: 4px; }
.tag .tk input.mont.sub { background: #DDEFFB; border-color: #9CC7E6; }
.tag .tk .montfeld { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; cursor: text; }
.tag .tf { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.tag .tf .summe { font-size: 11px; color: var(--schrift2); font-variant-numeric: tabular-nums; }
.eintrag .std { font-size: 11px; font-weight: 600; white-space: nowrap; flex: none; opacity: .95; }
.raster { display: grid; grid-template-columns: 44px repeat(7, 1fr); gap: 3px; }
.raster .kw, .raster .wt { font-size: 11px; color: var(--schrift2); text-align: center; padding: 4px 0; font-weight: 600; }
.raster .kw { align-self: stretch; display: flex; align-items: center; justify-content: center; background: var(--wochenende); border-radius: 6px; }
.tag { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px; min-height: 120px; padding: 4px; display: flex; flex-direction: column; gap: 3px; }
.tag.aussen { background: transparent; border-style: dashed; opacity: .55; }
.tag.frei { background: var(--wochenende); }
.tag.feiertag { background: var(--feiertag); }
.tag.heute { outline: 2px solid var(--akzent); outline-offset: -1px; }
.tag.ausserhalb { opacity: .7; }
.tag .tk { display: flex; align-items: center; gap: 4px; font-size: 12px; }
.tag .tk .nr { font-weight: 700; font-size: 14px; min-width: 20px; cursor: pointer; }
.tag .tk .nr.erster { color: var(--akzent); }
.tag .tk .ft { font-size: 10px; color: #8a2f45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.tag .tk input.mont { width: 3.2em; padding: 1px 4px; font-size: 12px; text-align: right; background: #FFF6CC; border-color: #E8D88A; }
.tag .tk .mlabel { font-size: 10px; color: var(--schrift2); }
.tag .plus { border: none; background: transparent; color: var(--schrift2); padding: 0 4px; font-size: 16px; line-height: 1; }
.tag .plus:hover { color: var(--akzent); }
.eintrag { border-radius: 6px; padding: 3px 5px 3px 6px; font-size: 12px; line-height: 1.25; cursor: pointer; display: flex; gap: 4px; align-items: flex-start; border-left: 4px solid transparent; }
.eintrag .txt { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.eintrag .txt small { display: block; opacity: .85; font-size: 11px; }
.eintrag .hk { width: 18px; height: 18px; border-radius: 4px; border: 1px solid rgba(0,0,0,.25); background: rgba(255,255,255,.55); display: inline-flex; align-items: center; justify-content: center; font-size: 12px; flex: none; }
.eintrag.fertig .hk { background: var(--gruen); color: #fff; border-color: var(--gruen); }
.eintrag.fertig .txt { opacity: .85; }
.eintrag.extern { border-left-style: dashed; }
.eintrag .q { font-size: 9px; opacity: .7; }
@media (max-width: 860px) {
  .raster { display: block; }
  .raster .wt, .raster .kw { display: none; }
  .tag { margin-bottom: 6px; min-height: 0; }
  .tag.aussen { display: none; }
  .tag .tk::before { content: attr(data-wt); font-weight: 600; color: var(--schrift2); min-width: 26px; }
}

/* Druckansicht */
.druck { background: #fff; padding: 10px; color: #000; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
.druck .dkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-bottom: 6px; }
.druck h1 { font-size: 18px; margin: 0; }
.druck .dsub { font-size: 11px; color: #444; margin-top: 2px; }
.druck .dlegende { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11px; }
.druck .dl i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; vertical-align: middle; margin-right: 3px; }
.druck table { table-layout: fixed; font-size: 10.5px; border-collapse: collapse; }
.druck th, .druck td { border: 1px solid #999; padding: 2px 3px; vertical-align: top; }
.druck th { background: #eee; color: #000; text-transform: none; font-size: 11px; letter-spacing: 0; }
.druck th.kw, .druck td.kw { width: 44px; text-align: center; background: #eee; }
.druck td.kw small { display: block; font-weight: 400; color: #444; }
.druck td.frei { background: #d9d9d9; }
.druck td.ft { background: var(--feiertag); }
.druck td.aussen { background: repeating-linear-gradient(135deg, #f3f3f3 0 4px, #e6e6e6 4px 8px); }
.druck .dt { display: flex; justify-content: space-between; gap: 4px; font-weight: 700; border-bottom: 1px solid #bbb; padding-bottom: 1px; margin-bottom: 2px; }
.druck .dt em { font-style: normal; font-weight: 400; color: #8a2f45; }
.druck .ez { display: flex; align-items: flex-start; gap: 3px; padding: 1px 0; border-bottom: 1px dotted #ddd; }
.druck .ez i { flex: none; width: 4px; align-self: stretch; border-radius: 2px; min-height: 10px; }
.druck .ez .hk { flex: none; width: 10px; color: #1e8f4e; font-weight: 700; }
.druck .ez .tx { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.druck .ez .tx small { color: #555; }
.druck .ez .st { flex: none; font-weight: 600; white-space: nowrap; }
.druck .ds { text-align: right; font-size: 10px; color: #444; margin-top: 2px; }
.druck tr { page-break-inside: avoid; break-inside: avoid; }
.druck thead { display: table-header-group; }
@media print {
  @page { size: A3 landscape; margin: 10mm; }
  .kopf, .nodruck { display: none !important; }
  .inhalt { padding: 0; max-width: none; }
  .druck { padding: 0; }
  body { background: #fff; }
}

/* Modal + Toast */
#modal[hidden], #toast[hidden], [hidden] { display: none !important; }
#modal { position: fixed; inset: 0; background: rgba(20,18,40,.55); display: flex; align-items: center; justify-content: center; z-index: 40; padding: 12px; }
#modal .box { background: #fff; border-radius: 12px; padding: 18px; width: min(560px, 100%); max-height: 95vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
#modal h2 { margin: 0 0 12px; }
#modal .formular input, #modal .formular select, #modal .formular textarea { width: 100%; }
#modal .knoepfe { display: flex; gap: 8px; margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: #0f0d22; color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 60; max-width: 90vw; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
#toast.fehler { background: #7a1f1f; }
/* Auftraege */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 14px; }
.karte.kpi { margin: 0; padding: 12px 14px; }
.kpi-t { font-size: 12px; color: var(--schrift2); }
.kpi-w { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
h2.abschnitt { margin: 22px 0 8px; padding-top: 12px; border-top: 1px solid var(--rand); color: var(--schrift2); font-size: 15px; text-transform: uppercase; letter-spacing: .06em; }
table.auftraege tr.gruppe-zeile td { background: var(--wochenende); font-weight: 600; padding-top: 10px; }
table.auftraege td.einzug { padding-left: 18px; white-space: nowrap; }
table.auftraege tr.nachlass td { color: var(--schrift2); }
table.auftraege tr.inaktiv td { color: var(--schrift2); text-decoration: none; opacity: .7; }
table.auftraege tr.zwischensumme td { font-weight: 600; background: #FAFBFD; }
table.auftraege tfoot tr.gesamt td { font-weight: 700; border-top: 2px solid var(--schrift2); }
table.auftraege th.m, table.auftraege td.m { text-align: center; width: 70px; }
table.auftraege input.bem { width: 14em; padding: 3px 6px; font-size: 12px; }
td.fett { font-weight: 600; }
ul.rechte { margin: 0; padding-left: 18px; color: var(--schrift2); font-size: 13px; line-height: 1.6; }
.projektkarte .balken { margin: 8px 0 6px; }
.projektkarte .unter2 { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--schrift2); }
.projektkarte .unter2 b { color: var(--schrift); font-variant-numeric: tabular-nums; }
.projektkarte .links a { font-size: 13px; }
.karte.gefahrenzone { border-color: #F2B8B5; margin-top: 14px; }
.karte.gefahrenzone h3 { color: var(--rot); margin-top: 0; }
.sw-gruppe { margin: 4px 0; line-height: 2; }
.chip.sw { background: #F1F2F7; border: 1px solid var(--rand); }
.chip.sw b { cursor: pointer; color: var(--rot); margin-left: 2px; }
.chip.ok2 { background: #DDF5E6; color: #1e6b3a; }
.chip.warn { background: #FFF3CD; color: #7a5a00; }
table.auftraege tr.unzug td { background: #FFF8E1; }
table.auftraege select.gm { padding: 2px 4px; font-size: 12px; }
table.auftraege td.z, table.auftraege th.z { white-space: nowrap; }
tr.inaktiv td { color: var(--schrift2); }
.datei-liste { font-size: 12px; color: var(--schrift2); }
.datei-liste li { display: flex; gap: 8px; align-items: center; }
.fortschritt { display: inline-block; width: 14px; height: 14px; border: 2px solid var(--rand); border-top-color: var(--akzent); border-radius: 50%; animation: dreh .8s linear infinite; vertical-align: middle; }
@keyframes dreh { to { transform: rotate(360deg); } }
.tab-leiste { display: flex; gap: 4px; border-bottom: 1px solid var(--rand); margin-bottom: 12px; }
.tab-leiste button { border: none; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; }
.tab-leiste button.aktiv { border-bottom-color: var(--akzent); color: var(--akzent); font-weight: 600; }
.farbe { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; margin-right: 6px; border: 1px solid rgba(0,0,0,.15); }
.scroll { overflow-x: auto; }
