/* Tourenplaner Online – Farben und Schriften nach Styleguide Kreisbereitschaft */
:root {
  --rot: #E60005;
  --dunkelblau: #002D55;
  --dunkelgrau: #7C7C7C;
  --hellgrau: #F0F0F0;
  --schwarz: #000;
  --weiss: #fff;
  --rand: #d6d6d6;
  --kopf-h: 64px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px; line-height: 1.4; color: var(--schwarz); background: var(--weiss);
}
h1, h2, h3 { font-family: Merriweather, Georgia, serif; color: var(--rot); font-weight: 700; margin: 0 0 .6em; }
h1 { font-size: 1.5rem; }
h2 { font-size: 1.15rem; margin-top: 1.4em; }
a { color: var(--dunkelblau); }
.klein { font-size: .85rem; color: var(--dunkelgrau); }
ul { padding-left: 1.2em; list-style: disc; }

/* Kopf mit Logo rechts */
.kopf { display: flex; justify-content: space-between; align-items: center; height: var(--kopf-h);
  padding: 0 16px; border-bottom: 1px solid var(--rand); gap: 16px; }
.kopf-links, .kopf-rechts { display: flex; align-items: center; gap: 18px; min-width: 0; }
.app-name { font-family: Merriweather, Georgia, serif; font-weight: 700; color: var(--rot); text-decoration: none; font-size: 1.1rem; white-space: nowrap; }
.app-name span { color: var(--dunkelblau); font-weight: 400; }
.kopf nav { display: flex; gap: 14px; }
.kopf nav a { text-decoration: none; color: var(--dunkelblau); }
.kopf nav a:hover { text-decoration: underline; }
.wer { color: var(--dunkelgrau); font-size: .9rem; white-space: nowrap; }
.logo { height: 44px; width: auto; }
.absender { font-size: .78rem; color: var(--dunkelgrau); padding: 3px 16px; border-bottom: 1px solid var(--hellgrau); }

.inhalt { max-width: 1100px; margin: 0 auto; padding: 20px 16px 40px; }
.inhalt-voll { padding: 12px 16px; }

/* Meldungen und Infokästen (Hellgrau mit Dunkelblau) */
.meldung { padding: 10px 14px; margin-bottom: 12px; border-left: 4px solid var(--dunkelblau); background: var(--hellgrau); }
.meldung.fehler { border-left-color: var(--rot); }
.info { background: var(--hellgrau); border-left: 4px solid var(--dunkelblau); padding: 10px 14px; margin: 12px 0; color: var(--dunkelblau); }
.info ul { margin: .3em 0; }

/* Formulare */
label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .9rem; }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; font: inherit;
  font-weight: 400; border: 1px solid var(--rand); border-radius: 4px; background: var(--weiss); }
input:focus, select:focus { outline: 2px solid var(--dunkelblau); outline-offset: 0; }
button, .knopf { display: inline-block; padding: 8px 16px; font: inherit; font-weight: 600; border: 1px solid var(--dunkelblau);
  background: var(--weiss); color: var(--dunkelblau); border-radius: 4px; cursor: pointer; text-decoration: none; }
button:disabled { opacity: .45; cursor: default; }
button.primaer, .knopf.primaer { background: var(--rot); border-color: var(--rot); color: var(--weiss); }
button.rot { background: var(--weiss); border-color: var(--rot); color: var(--rot); }
button.link { border: 0; padding: 0; background: none; color: var(--dunkelblau); font-weight: 400; text-decoration: underline; }
button.link.rot { color: var(--rot); }
form.inline { display: inline; }
.karte-schmal { max-width: 440px; margin: 30px auto; padding: 24px; border: 1px solid var(--rand); border-radius: 6px; }
.karte-schmal.breit { max-width: 620px; }
.karte-schmal button.primaer { width: 100%; padding: 10px; margin-top: 6px; }
.formular-zeile { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.formular-zeile label { flex: 1 1 200px; margin: 0; }
.knopfleiste { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.spacer { flex: 1; }
.zeile-titel { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.zeile-titel h1 { margin: 0; }
.pflicht { font-size: .75rem; color: var(--rot); font-weight: 600; }
.link-kopie { display: flex; gap: 8px; margin-top: 6px; }
.link-kopie input { margin: 0; }
.check { display: flex; align-items: center; gap: 6px; margin: 0; font-weight: 400; white-space: nowrap; }
.check input { width: auto; margin: 0; }

/* Tabellen */
.liste { width: 100%; border-collapse: collapse; font-size: .92rem; }
.liste th { text-align: left; background: var(--hellgrau); color: var(--dunkelblau); padding: 7px 8px; font-weight: 600;
  position: sticky; top: 0; z-index: 1; }
.liste td { padding: 6px 8px; border-bottom: 1px solid var(--hellgrau); vertical-align: top; }
.liste .zahl { text-align: right; font-variant-numeric: tabular-nums; }
.liste tr.gesperrt td { color: var(--dunkelgrau); }
.liste td.aktionen button { margin-right: 10px; }
.liste select { margin: 0; padding: 4px 6px; width: auto; }
.zuordnung { max-width: 640px; }
.zuordnung select { width: 100%; }
.scroll-x { overflow-x: auto; }
.vorschau td { white-space: nowrap; }
.leer { color: var(--dunkelgrau); padding: 20px 0; }

/* Aktion: Kopf, Werkzeuge, Tabelle + Karte */
body.vollbild { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body.vollbild main { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.aktion-kopf { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.aktion-kopf h1 { margin: 0 0 2px; }
.zaehler { display: flex; gap: 14px; flex-wrap: wrap; font-size: .88rem; }
.zaehler span { white-space: nowrap; }
.werkzeuge { display: flex; align-items: center; gap: 12px; margin: 10px 0; flex-wrap: wrap; }
.werkzeuge input[type=search] { width: 220px; margin: 0; }
.geo-stand { font-size: .88rem; color: var(--dunkelgrau); }
.geo-stand.laeuft { color: var(--dunkelblau); font-weight: 600; }
.geo-stand.fehler { color: var(--rot); font-weight: 600; }
.geteilt { flex: 1; display: grid; grid-template-columns: minmax(420px, 46%) 1fr; gap: 12px; min-height: 0; }
.tabelle-box { overflow: auto; border: 1px solid var(--rand); }
#map { min-height: 300px; border: 1px solid var(--rand); }
.stopps tbody tr { cursor: pointer; }
.stopps tbody tr:hover td { background: #f7f7f7; }
.stopps tr.gewaehlt td { background: var(--hellgrau); box-shadow: inset 0 0 0 0 var(--dunkelblau); }
.stopps tr.gewaehlt td:first-child { box-shadow: inset 4px 0 0 var(--dunkelblau); }

/* Lage-Kennzeichen (nur Styleguide-Farben) */
.lage { display: inline-block; font-size: .78rem; padding: 1px 7px; border-radius: 10px; white-space: nowrap; border: 1px solid; }
.lage.geo-exakt { color: var(--dunkelblau); border-color: var(--dunkelblau); }
.lage.geo-ungenau { color: var(--dunkelgrau); border-color: var(--dunkelgrau); border-style: dashed; }
.lage.geo-nicht { color: var(--weiss); background: var(--rot); border-color: var(--rot); }
.lage.geo-manuell { color: var(--weiss); background: var(--dunkelblau); border-color: var(--dunkelblau); }
.lage.geo-offen { color: var(--dunkelgrau); border-color: var(--rand); }
.zaehler .geo-nicht b { color: var(--rot); }

/* Marker auf der Karte */
.nr-icon { width: 26px; height: 26px; border-radius: 50%; color: var(--weiss); font: 700 11px/22px Arial, sans-serif;
  text-align: center; border: 2px solid var(--weiss); box-shadow: 0 1px 3px rgba(0,0,0,.45); background: var(--dunkelblau); }
.nr-icon.geo-ungenau { background: var(--dunkelgrau); }
.nr-icon.geo-nicht { background: var(--rot); }
.nr-icon.geo-manuell { background: var(--dunkelblau); border-color: var(--rot); }
.nr-icon.selected { transform: scale(1.35); border-color: var(--rot); }

.nr-icon.fertig { opacity: .45; }
.depot-icon { width: 28px; height: 28px; background: var(--schwarz); color: var(--weiss); font: 700 14px/28px Arial, sans-serif;
  text-align: center; border: 2px solid var(--weiss); box-shadow: 0 1px 4px rgba(0,0,0,.5); }
.kontext { display: flex; flex-direction: column; gap: 6px; }

/* Planung */
details.planung { border: 1px solid var(--rand); border-radius: 4px; padding: 6px 12px; margin: 10px 0 0; background: #fafafa; }
details.planung summary { cursor: pointer; font-weight: 600; color: var(--dunkelblau); }
.planung-raster { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 16px; padding-top: 8px; }
.feld-gruppe { min-width: 0; }
.feld-titel { display: block; font-weight: 600; font-size: .85rem; color: var(--dunkelblau); margin-bottom: 2px; }
.ort-text { display: block; font-size: .85rem; color: var(--dunkelgrau); margin-bottom: 4px; overflow-wrap: anywhere; }
.such-zeile { display: flex; gap: 6px; }
.such-zeile input, .feld-gruppe select { margin: 0; }
.such-zeile button { padding: 6px 10px; }
.opt-zeile { display: flex; gap: 10px; flex-wrap: wrap; }
.opt-zeile label { margin: 0; font-size: .8rem; flex: 1 1 110px; }
.opt-zeile input, .opt-zeile select { padding: 5px 8px; }
.feld-gruppe .knopfleiste { margin-top: 8px; flex-wrap: wrap; gap: 8px; }
.feld-gruppe .knopfleiste .knopf, .feld-gruppe .knopfleiste button { padding: 6px 12px; }
#plan-info { margin-top: 6px; }
.team-leiste { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.team-chip { border: 1px solid var(--rand); border-left: 6px solid var(--dunkelgrau); padding: 4px 10px; border-radius: 3px;
  display: flex; flex-direction: column; background: var(--weiss); }
.team-chip.ohne { color: var(--rot); border-left-color: var(--rot); justify-content: center; }
.team-name { font-weight: 700; text-decoration: none; text-align: left; }
.stopps tr.team-kopf td { background: var(--weiss); font-weight: 700; color: var(--dunkelblau); border-left: 6px solid var(--dunkelgrau);
  border-bottom: 2px solid var(--hellgrau); padding-top: 10px; position: static; }
.stopps tr.fertig td { color: var(--dunkelgrau); text-decoration: line-through; }
.team-wahl { font-size: .8rem; padding: 2px 4px !important; max-width: 110px; }
td.pfeile { white-space: nowrap; }
.pfeil { border: 0; background: none; padding: 0 2px; color: var(--dunkelblau); font-size: .75rem; }

/* QR-Seite */
.qr-karten { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; }
.qr-karte { border: 1px solid var(--rand); border-radius: 6px; padding: 18px; }
.qr-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; flex-direction: row-reverse; }
.qr-bild svg { width: 220px; height: 220px; display: block; margin: 8px auto; }
.team-punkt { display: inline-block; width: 14px; height: 14px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.gross { font-size: 1.1rem; font-weight: 600; text-align: center; }
.link-text { overflow-wrap: anywhere; }
.tourliste li { margin-bottom: 8px; }
@media print {
  .kopf, .absender, .nicht-drucken, .meldung { display: none !important; }
  .inhalt { max-width: none; padding: 0; }
  .qr-karten { display: block; }
  .qr-karte { page-break-after: always; border: 0; padding: 10mm; }
  .qr-bild svg { width: 90mm; height: 90mm; }
}

/* Dialog */
dialog { border: 1px solid var(--rand); border-radius: 6px; padding: 20px 24px; width: min(620px, 94vw); }
dialog::backdrop { background: rgba(0, 0, 0, .35); }
.raster2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.raster2 .breit { grid-column: 1 / -1; }

details.gefahr { margin-top: 10px; font-size: .88rem; }
details.gefahr summary { color: var(--rot); cursor: pointer; }
details.gefahr form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 0; }
details.gefahr p { flex-basis: 100%; margin: 0; }
details.gefahr input { width: 260px; margin: 0; }

/* Handy und schmale Fenster */
@media (max-width: 1200px) {
  .planung-raster { grid-template-columns: 1fr 1fr; }
  .planung-raster .feld-gruppe:last-child { grid-column: 1 / -1; }
}
@media (max-width: 900px) {
  .planung-raster { grid-template-columns: 1fr; }
  body.vollbild { height: auto; overflow: auto; }
  .geteilt { grid-template-columns: 1fr; }
  #map { height: 60vh; order: -1; }
  .tabelle-box { max-height: 70vh; }
  .wer, .absender { display: none; }
  .kopf nav { gap: 10px; font-size: .9rem; }
}
@media (max-width: 560px) {
  .logo { height: 34px; }
  .kopf nav { display: none; }
  .raster2 { grid-template-columns: 1fr; }
}

/* ---------- Lagebild ---------- */
.lb-kopf { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-bottom: 8px; }
.lb-titel { flex: 1 1 280px; min-width: 0; }
.lb-titel h1 { margin: 0 0 2px; }
.lb-summe { display: flex; gap: 22px; }
.lb-summe div { display: flex; flex-direction: column; align-items: center; }
.lb-summe b { font-size: 1.7rem; color: var(--dunkelblau); line-height: 1.1; }
.lb-summe span { font-size: .8rem; color: var(--dunkelgrau); }
.lb-knoepfe { display: flex; gap: 8px; }
.lb-balken { height: 10px; background: var(--hellgrau); border-radius: 5px; overflow: hidden; margin-bottom: 10px; }
.lb-balken span { display: block; height: 100%; width: 0; background: var(--dunkelblau); transition: width .5s; }
.lb-raster { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr 380px; gap: 12px; }
#lb-karte { min-height: 300px; border: 1px solid var(--rand); }
.lb-seite { overflow-y: auto; min-height: 0; padding-right: 4px; }
.lb-seite h2 { margin-top: 16px; }
.lb-filter { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.inline-check input { width: auto; margin: 0; }
.lb-team { display: block; width: 100%; text-align: left; font-weight: 400; color: var(--schwarz); margin-bottom: 8px;
  padding: 8px 10px; border: 1px solid var(--rand); border-left: 6px solid var(--c); border-radius: 4px; background: var(--weiss); }
.lb-team.aktiv { outline: 2px solid var(--dunkelblau); background: var(--hellgrau); }
.lb-team-kopf { display: flex; align-items: center; gap: 8px; }
.lb-team-kopf b { flex: 1; color: var(--dunkelblau); }
.lb-prozent { font-weight: 700; color: var(--dunkelblau); }
.lb-voll { background: var(--rot); color: var(--weiss); font-size: .75rem; font-weight: 700; padding: 1px 7px; border-radius: 10px; }
.lb-team-balken { height: 6px; background: var(--hellgrau); border-radius: 3px; overflow: hidden; margin: 5px 0 4px; }
.lb-team-balken span { display: block; height: 100%; background: var(--c); }
.lb-warn { color: var(--rot); }
.lb-meldungen { list-style: none; padding: 0; margin: 0; font-size: .88rem; }
.lb-meldungen li { padding: 4px 0; border-bottom: 1px solid var(--hellgrau); }
.lb-meldungen .zeit { color: var(--dunkelgrau); font-variant-numeric: tabular-nums; }
.lb-fehler { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); z-index: 2000; }
.lb-pin { width: 24px; height: 24px; border-radius: 50%; background: var(--c); color: var(--weiss); border: 2px solid var(--weiss);
  font: 700 11px/20px Arial, sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.lb-pin.erledigt { background: var(--dunkelgrau); opacity: .55; transform: scale(.8); }
.lb-pin.kein_baum { background: var(--weiss); color: var(--dunkelgrau); border-color: var(--dunkelgrau); opacity: .7; transform: scale(.8); }
.lb-pin.notiz { box-shadow: 0 0 0 3px var(--rot); }
.lb-auto { display: inline-block; white-space: nowrap; transform: translate(-50%, -50%); background: var(--c); color: var(--weiss);
  font: 700 12px/1 Arial, sans-serif; padding: 6px 9px; border: 2px solid var(--weiss); border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,.5); }
.lb-auto.voll { outline: 3px solid var(--rot); }
.lb-auto.alt { opacity: .45; }
@media (max-width: 900px) {
  .lb-raster { grid-template-columns: 1fr; }
  #lb-karte { height: 60vh; }
  .lb-summe { gap: 14px; }
  .lb-summe b { font-size: 1.3rem; }
}

/* Tourenberechnung im Hintergrund */
.plan-stand { background: #F0F0F0; border-left: 4px solid #002D55; padding: .5rem .75rem; margin: .4rem 0; }
.plan-stand-leiste { height: 6px; background: #fff; margin-top: .35rem; }
.plan-stand-leiste span { display: block; height: 100%; width: 0; background: #002D55; transition: width .4s; }
