@font-face { font-family: "Open Sans"; font-style: normal; font-weight: 300 800; font-display: swap; src: url("../fonts/open-sans-latin.woff2") format("woff2"); }
:root {
  --bg: #f5f6f8;
  --karte: #fff;
  --text: #1d2433;
  --leise: #667085;
  --linie: #e3e6eb;
  --blau: #004f9f;
  --blau-2: #4564b3;
  --blau-3: #60a5bf;
  --blau-hell: #e6eef7;
  --gruen: #2e7d4f;
  --gruen-hell: #e3f3e8;
  --gelb: #b7791f;
  --gelb-hell: #fdf3dc;
  --rot: #c0392b;
  --rot-hell: #fbe6e3;
  --grau-hell: #eef0f3;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.5 "Open Sans", Helvetica, Arial, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--blau); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 24px; margin: 0 0 4px; color: var(--blau); font-weight: 700; }
h2 { font-size: 16px; margin: 0 0 12px; }
.leise { color: var(--leise); }
.klein { font-size: 13px; }

/* Kopf */
.kopf { background: #fff; border-bottom: 4px solid var(--blau); }
.kopf-innen { max-width: 1280px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 28px; height: 68px; }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.kampagnenwahl { display: flex; align-items: center; gap: 8px; }
.kampagnenwahl select { width: auto; min-width: 210px; font-weight: 600; color: var(--blau); border-color: var(--blau); }
.menue { position: relative; }
.menue summary { cursor: pointer; list-style: none; padding: 7px 12px; border-radius: 6px; font-weight: 600; font-size: 14px; white-space: nowrap; }
.menue summary::-webkit-details-marker { display: none; }
.menue summary::after { content: " ▾"; color: var(--leise); }
.menue summary:hover, .menue[open] summary { background: var(--blau-hell); }
.menue-liste { position: absolute; right: 0; top: calc(100% + 6px); background: #fff; border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.08); min-width: 200px; padding: 6px; z-index: 10; }
.menue-liste a, .menue-liste button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; font-size: 14px; cursor: pointer; }
.menue-liste a:hover, .menue-liste button:hover { background: var(--blau-hell); text-decoration: none; }
.menue-liste form { margin: 0; border-top: 1px solid var(--linie); margin-top: 4px; padding-top: 4px; }
.marke { display: flex; align-items: center; gap: 10px; color: var(--blau); white-space: nowrap; line-height: 1.15; }
.marke:hover { text-decoration: none; }
.marke img { width: 46px; height: 46px; }
.marke b { display: block; font-size: 17px; font-weight: 700; }
.marke small { display: block; font-size: 12px; color: var(--leise); }
.nav { display: flex; gap: 2px; overflow-x: auto; max-width: 1280px; margin: 0 auto; padding: 0 20px 8px; scrollbar-width: none; }
.nav form { margin: 0; }
.nav button { background: none; border: 0; font: inherit; font-weight: 600; font-size: 14px; color: var(--text); padding: 8px 12px; border-radius: 6px; cursor: pointer; text-align: left; }
.nav a { color: var(--text); padding: 8px 12px; border-radius: 6px; white-space: nowrap; font-weight: 600; font-size: 14px; }
.nav a:hover { background: var(--blau-hell); text-decoration: none; }
.nav a.aktiv { background: var(--blau); color: #fff; }

main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
.seitenkopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }

.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 20px; }
.karte.eng { padding: 0; overflow-x: auto; }
.karte.eng h2 { padding: 16px 20px 0; }
.raster { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.raster > .karte { margin-bottom: 0; }

/* Kacheln */
.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.kachel { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; }
.kachel b { display: block; font-size: 26px; line-height: 1.1; }
.kachel.warn b { color: var(--rot); }

/* Tabellen */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--linie); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--leise); font-weight: 600; background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
tr.erledigt td { color: var(--leise); }
tr.erledigt td .titel { text-decoration: line-through; }
.gruppe td { background: #fafbfc; font-weight: 600; }

/* Buttons und Formulare */
.knopf { display: inline-block; border: 1px solid var(--blau); background: var(--blau); color: #fff; padding: 7px 14px; border-radius: 6px; font: inherit; cursor: pointer; }
.knopf:hover { text-decoration: none; filter: brightness(1.1); }
.knopf.zweit { background: #fff; color: var(--blau); }
.knopf.klein { padding: 4px 10px; font-size: 13px; }
.knopf.gefahr { background: #fff; color: var(--rot); border-color: var(--rot); }
.knopfreihe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline { display: inline; }

.formular { max-width: 640px; }
.feld { margin-bottom: 14px; }
.feld label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.feld .hinweis { font-size: 12px; color: var(--leise); margin-top: 3px; }
input[type=text], input[type=number], input[type=date], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}
textarea { min-height: 90px; }
.felder-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.felder-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.fehler { color: var(--rot); font-size: 13px; margin-top: 3px; }
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 16px; }
.filter select { width: auto; min-width: 160px; }
select.status { width: auto; padding: 3px 6px; font-size: 13px; }

.fehlermeldung { background: var(--rot-hell) !important; border-color: #f0b8b0 !important; color: var(--rot) !important; }
tr.inaktiv td { color: var(--leise); }
.haken { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; cursor: pointer; }
.haken input { width: 16px; height: 16px; }
input[type=email], input[type=password] {
  width: 100%; padding: 8px 10px; border: 1px solid #cfd4dc; border-radius: 6px; font: inherit; background: #fff; color: var(--text);
}

/* Anmeldung */
body.schlicht { display: flex; justify-content: center; align-items: flex-start; min-height: 100vh; padding: 8vh 16px; background: var(--bg); }
.anmeldebox { width: 100%; max-width: 440px; }
.anmeldebox .marke { margin-bottom: 18px; }
.anmeldebox .karte { max-width: none; }

/* Dateien */
.bilder { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.bilder figure { margin: 0; border: 1px solid var(--linie); border-radius: 6px; overflow: hidden; background: #fafbfc; }
.bilder img { display: block; width: 100%; height: 110px; object-fit: cover; }
.bilder figcaption { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 4px 8px; font-size: 12px; color: var(--leise); }
.link-rot { background: none; border: 0; color: var(--rot); font-size: 16px; cursor: pointer; padding: 0 2px; }
.dateien table { margin-bottom: 10px; }
.hochladen { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--linie); }
.hochladen input[type=file] { font: inherit; font-size: 13px; max-width: 100%; }

.meldung { background: var(--gruen-hell); border: 1px solid #b7dfc4; color: #1e5a37; padding: 10px 14px; border-radius: 6px; margin-bottom: 18px; }

/* Status */
.marke-status { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; white-space: nowrap; }
.s-offen { background: var(--grau-hell); color: #444; }
.s-in_arbeit { background: var(--blau-hell); color: var(--blau); }
.s-erledigt { background: var(--gruen-hell); color: var(--gruen); }
.rot { color: var(--rot); }

/* Fortschritt */
.balken { height: 8px; background: var(--grau-hell); border-radius: 4px; overflow: hidden; min-width: 80px; }
.balken > i { display: block; height: 100%; background: var(--blau); }
.balken.gut > i { background: var(--gruen); }

/* Auslastung */
.auslastung { overflow-x: auto; }
.auslastung table { min-width: 900px; }
.auslastung th, .auslastung td { text-align: center; padding: 6px 4px; }
.auslastung th:first-child, .auslastung td:first-child { text-align: left; padding-left: 16px; white-space: nowrap; }
.auslastung th.heute { background: var(--blau-hell); color: var(--blau); }
.zelle { display: block; border-radius: 5px; padding: 6px 2px; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text); }
a.zelle:hover { outline: 2px solid var(--blau); text-decoration: none; }
.zelle.leer { color: #b5bcc7; }
.zelle.wenig { background: #f1f5fb; }
.zelle.passt { background: var(--gruen-hell); }
.zelle.voll { background: var(--gelb-hell); }
.zelle.ueber { background: var(--rot-hell); color: var(--rot); font-weight: 600; }
.zelle.ohne { background: var(--grau-hell); color: var(--leise); }
.zelle.gewaehlt { outline: 2px solid var(--blau); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--leise); }
.legende .zelle { border: 1px solid #d5dae2; display: inline-block; width: 22px; padding: 2px 0; margin-right: 4px; vertical-align: middle; }

/* Zeitplan */
.zeitplan { overflow-x: auto; }
.zp { min-width: 1000px; }
.zp-zeile { display: grid; grid-template-columns: 300px 1fr; border-bottom: 1px solid var(--linie); }
.zp-zeile > div:first-child { padding: 5px 12px 5px 16px; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zp-spur { position: relative; min-height: 28px; }
.zp-kopf { background: #fafbfc; font-size: 12px; color: var(--leise); }
.zp-kopf .zp-spur span { position: absolute; top: 0; bottom: 0; padding: 6px 4px; border-left: 1px solid var(--linie); }
.zp-gruppe { background: #fafbfc; }
.zp-gruppe > div:first-child { font-weight: 600; }
.zp-gitter { position: absolute; top: 0; bottom: 0; border-left: 1px solid #f0f1f4; }
.zp-heute { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--rot); z-index: 2; }
.zp-balken { position: absolute; top: 6px; height: 16px; border-radius: 4px; background: var(--blau-3); font-size: 11px; line-height: 16px; color: #fff; padding: 0 5px; white-space: nowrap; overflow: hidden; z-index: 1; }
.zp-balken.in_arbeit { background: var(--blau); }
.zp-balken.erledigt { background: #8fc5a3; }
.zp-balken.ueberfaellig { background: var(--rot); }
.zp-rahmen { position: absolute; top: 9px; height: 10px; border-radius: 3px; background: #d5dce6; }

/* KPI-Verlauf */
.verlauf { width: 100%; height: auto; aspect-ratio: 600 / 220; }


/* ---------- Responsiv ---------- */
.menueknopf { display: none; }
.nur-handy, .nur-mittel { display: none; }
td.nur-handy, th.nur-handy { display: none; }
td.nw, th.nw { white-space: nowrap; }
.kartenkopf { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-right: 20px; }
table.kompakt th, table.kompakt td { padding: 7px 8px; }

/* Wischbare Raster: erste Spalte bleibt stehen */
.wischbar { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.auslastung th:first-child, .auslastung td:first-child { position: sticky; left: 0; background: #fff; z-index: 3; box-shadow: 1px 0 0 var(--linie); }
.auslastung tr:first-child th:first-child { background: #fafbfc; }
.zp-zeile > div:first-child { position: sticky; left: 0; z-index: 3; background: #fff; box-shadow: 1px 0 0 var(--linie); }
.zp-kopf > div:first-child, .zp-gruppe > div:first-child { background: #fafbfc; }

/* Finger statt Maus: größere Ziele */
@media (pointer: coarse) {
  .knopf { padding: 10px 16px; }
  .knopf.klein { padding: 7px 12px; }
  select.status { padding: 7px 8px; font-size: 14px; }
  input[type=text], input[type=number], input[type=date], input[type=email], input[type=password], select, textarea { padding: 10px 12px; font-size: 16px; }
  .nav a, .nav button { padding: 10px 14px; }
  .zelle { padding: 9px 2px; }
}

/* iPad und kleine Bildschirme */
@media (max-width: 1100px) {
  main { padding: 20px 16px 48px; }
  .kopf-innen { padding: 0 16px; gap: 16px; }
  .nav { padding: 0 16px 8px; }
  .nur-gross { display: none !important; }
  .nur-mittel { display: block; }
  th, td { padding: 9px 8px; }
  .raster { grid-template-columns: 1fr; }
  .kampagnenwahl select { min-width: 180px; }
}

/* Handy */
@media (max-width: 700px) {
  body { font-size: 15px; }
  h1 { font-size: 22px; }
  main { padding: 16px 12px 40px; }
  .nicht-handy { display: none !important; }
  .nur-handy { display: inline; }
  .nur-mittel { display: block; }

  /* Kopf: Logo + Menü-Knopf, darunter die Kampagne */
  .kopf-innen { height: auto; flex-wrap: wrap; padding: 10px 12px; gap: 10px; }
  .marke img { width: 38px; height: 38px; }
  .marke b { font-size: 16px; }
  .marke small { display: block; }
  .menueknopf { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; background: #fff; border: 1px solid var(--blau); color: var(--blau); border-radius: 6px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
  .kopf-rechts { margin-left: 0; width: 100%; }
  .kampagnenwahl { width: 100%; }
  .kampagnenwahl label { display: none; }
  .kampagnenwahl select { flex: 1; min-width: 0; }
  .nav { display: none; flex-direction: column; padding: 0 12px 12px; gap: 2px; }
  .kopf.offen .nav { display: flex; }
  .nav a, .nav button { width: 100%; font-size: 15px; }
  .nav .nur-handy, .nav form.nur-handy { display: block; }
  .nav-trenner { border-top: 1px solid var(--linie); margin: 6px 0; }

  .seitenkopf { align-items: flex-start; gap: 10px; margin-bottom: 14px; }
  .seitenkopf > .knopf, .seitenkopf > .knopfreihe { width: 100%; }
  .seitenkopf > .knopf { text-align: center; }
  .kacheln { grid-template-columns: 1fr 1fr; gap: 8px; }
  .kachel { padding: 10px 12px; }
  .kachel b { font-size: 22px; }
  .karte { padding: 14px; margin-bottom: 14px; }
  .karte.eng h2 { padding: 14px 14px 0; }
  .kartenkopf { padding-right: 14px; }
  .filter { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .filter > div { display: flex; flex-direction: column; }
  .filter select { width: 100%; min-width: 0; }
  .formular { max-width: none; }
  .felder-2, .felder-3 { grid-template-columns: 1fr; gap: 0; }
  .bilder { grid-template-columns: repeat(2, 1fr); }
  .hochladen input[type=file] { width: 100%; }
  .legende { gap: 8px 12px; }

  /* Listen als Karten */
  table.karten, table.karten tbody { display: block; }
  table.karten tr:has(> th) { display: none; }
  table.karten tr { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; padding: 12px 14px; border-bottom: 1px solid var(--linie); }
  table.karten tr:last-child { border-bottom: 0; }
  table.karten td { display: block; border: 0; padding: 0; text-align: left; min-width: 0; }
  table.karten td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; color: var(--leise); margin-bottom: 1px; }
  table.karten td.k-kopf { grid-column: 1 / -1; font-weight: 600; font-size: 15px; }
  table.karten td.k-voll, table.karten td[colspan] { grid-column: 1 / -1; }
  table.karten td.k-aktion { grid-column: 1 / -1; display: flex; align-items: end; justify-content: flex-end; }
  table.karten td.k-breit2 { grid-column: span 2; overflow-wrap: anywhere; }
  table.karten3 tr { grid-template-columns: 1.25fr 1.15fr .6fr; }
  table.karten3 td.k-status { grid-column: span 2; }
  table.karten3 td.k-status + td.k-aktion { grid-column: auto; }
  table.karten tr.gruppe { display: block; padding: 8px 14px; background: #fafbfc; }
  table.karten .balken { min-width: 0; }

  /* Raster schmaler */
  .auslastung table { min-width: 640px; }
  .auslastung th:first-child, .auslastung td:first-child { padding-left: 10px; min-width: 118px; max-width: 140px; white-space: normal; }
  .zp { min-width: 820px; }
  .zp-zeile { grid-template-columns: 150px 1fr; }
  .zp-zeile > div:first-child { padding-left: 10px; }
}
