:root {
  --kopf: #0f1f33;
  --kopf-text: #e6edf5;
  --akzent: #f59e0b;
  --hg: #f4f6f9;
  --karte-hg: #ffffff;
  --text: #1c2733;
  --leise: #64748b;
  --linie: #e2e8f0;
  --faehrt: #16a34a;
  --steht: #d97706;
  --offline: #94a3b8;
  --fehler: #dc2626;
  --radius: 10px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--hg); }
button, input, select { font: inherit; }

/* ---------- Kopf ---------- */
.kopf {
  height: 52px; display: flex; align-items: center; gap: 18px;
  padding: 0 16px; background: var(--kopf); color: var(--kopf-text);
}
.logo { font-weight: 800; font-size: 20px; letter-spacing: -0.5px; }
.logo span { color: var(--akzent); }
.kundenname { font-weight: 600; opacity: .9; }
.kundenwahl select {
  background: #1b304a; color: var(--kopf-text); border: 1px solid #2c4666;
  border-radius: 6px; padding: 5px 8px;
}
.kopf nav { margin-left: auto; display: flex; gap: 16px; }
.kopf nav a { color: var(--kopf-text); text-decoration: none; opacity: .8; font-size: 14px; }
.kopf nav a:hover { opacity: 1; }

/* ---------- Aufbau ---------- */
.haupt { display: grid; grid-template-columns: 340px 1fr; height: calc(100% - 52px); }
#karte { height: 100%; }
.seite {
  background: var(--karte-hg); border-right: 1px solid var(--linie);
  display: flex; flex-direction: column; min-height: 0;
}
.reiter { display: flex; border-bottom: 1px solid var(--linie); }
.reiter button {
  flex: 1; padding: 12px; background: none; border: 0; cursor: pointer;
  font-weight: 600; color: var(--leise); border-bottom: 3px solid transparent;
}
.reiter button.aktiv { color: var(--text); border-bottom-color: var(--akzent); }
.reiterinhalt { display: none; flex-direction: column; min-height: 0; flex: 1; padding: 12px; gap: 10px; overflow: auto; }
.reiterinhalt.aktiv { display: flex; }

/* ---------- Live-Liste ---------- */
.zaehler { display: flex; gap: 14px; font-size: 13px; color: var(--leise); }
.zaehler span { display: flex; align-items: center; gap: 6px; }
#suche, .seite select, .seite input[type=date] {
  width: 100%; padding: 8px 10px; border: 1px solid var(--linie); border-radius: 8px; background: #fff;
}
.liste { list-style: none; margin: 0; padding: 0; overflow: auto; flex: 1; }
.fz {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px;
  border-bottom: 1px solid var(--linie); cursor: pointer; border-radius: 6px;
}
.fz:hover { background: #f1f5f9; }
.fz-text { flex: 1; min-width: 0; }
.fz-name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fz-status { font-size: 13px; color: var(--leise); }
.fz-alter { font-size: 12px; color: var(--leise); white-space: nowrap; }
.punkt { width: 11px; height: 11px; border-radius: 50%; display: inline-block; flex: none; }
.punkt.s-faehrt { background: var(--faehrt); box-shadow: 0 0 0 3px #16a34a33; }
.punkt.s-steht { background: var(--steht); }
.punkt.s-offline, .punkt.s-keine_daten { background: var(--offline); }
.fuss { font-size: 12px; color: var(--leise); }

/* ---------- Kartenmarker ---------- */
.mk-wrap { background: none; border: 0; }
.mk {
  width: 18px; height: 18px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.4); position: relative;
}
.mk.s-faehrt { background: var(--faehrt); }
.mk.s-steht { background: var(--steht); }
.mk.s-offline, .mk.s-keine_daten { background: var(--offline); }
.mk i {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; margin: -17px 0 0 -5px;
  border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--faehrt);
  transform-origin: 5px 17px;
}
.mk-name {
  position: absolute; left: 22px; top: -1px; white-space: nowrap;
  background: rgba(255,255,255,.92); padding: 1px 6px; border-radius: 4px;
  font-size: 12px; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.pop { min-width: 190px; line-height: 1.45; }
.pop-status { font-weight: 600; }
.pop-status.s-faehrt { color: var(--faehrt); }
.pop-status.s-steht { color: var(--steht); }
.pop-status.s-offline { color: var(--leise); }
.pop-verlauf { display: inline-block; margin-top: 6px; }
.werte { border-collapse: collapse; margin-top: 6px; font-size: 12px; width: 100%; }
.werte td { padding: 2px 0; border-top: 1px solid var(--linie); }
.werte td:last-child { text-align: right; font-weight: 600; padding-left: 10px; white-space: nowrap; }
.status-ok { color: var(--faehrt); font-weight: 700; }
.status-warn { color: var(--steht); font-weight: 700; }
.status-fehler { color: var(--fehler); font-weight: 700; }
.verwaltung h2 { margin-top: 28px; font-size: 18px; }
.verwaltung select { padding: 6px; border: 1px solid var(--linie); border-radius: 6px; }
.klein { font-size: 12px; color: var(--leise); }
.alarm { color: var(--fehler); font-weight: 600; }

/* ---------- Verlauf ---------- */
.seite label { font-size: 13px; color: var(--leise); display: flex; flex-direction: column; gap: 4px; }
.datumzeile { display: flex; gap: 6px; }
.datumzeile button {
  width: 38px; border: 1px solid var(--linie); background: #fff; border-radius: 8px; cursor: pointer; font-size: 18px;
}
.kacheln { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kachel { background: var(--hg); border-radius: var(--radius); padding: 10px; }
.k-titel { font-size: 12px; color: var(--leise); }
.k-wert { font-size: 17px; font-weight: 700; margin-top: 2px; }
.abspielen { margin: 10px 0 4px; }
.abspielen input { width: 100%; accent-color: var(--akzent); }
.v-inhalt h3 { font-size: 14px; margin: 14px 0 6px; }
.stopps { list-style: none; padding: 0; margin: 0; }
.stopps li {
  display: flex; align-items: center; gap: 10px; padding: 8px 4px;
  border-bottom: 1px solid var(--linie); cursor: pointer; font-size: 14px;
}
.stopps li div { flex: 1; }
.stopps li:hover { background: #f1f5f9; }
.stopp-wrap { background: none; border: 0; }
.stopp {
  width: 22px; height: 22px; border-radius: 50%; background: var(--steht); color: #fff;
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); flex: none;
}
.hinweis { color: var(--leise); }
.fehler { color: var(--fehler); }

/* ---------- Login ---------- */
.login-seite { display: grid; place-items: center; background: var(--kopf); }
.login {
  background: #fff; padding: 28px; border-radius: 14px; width: min(340px, 92vw);
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 10px 40px rgba(0,0,0,.3);
}
.login .logo { font-size: 26px; text-align: center; color: var(--kopf); }
.login label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--leise); }
.login input { padding: 10px; border: 1px solid var(--linie); border-radius: 8px; }
.login button, .knopf {
  padding: 10px 14px; border: 0; border-radius: 8px; background: var(--kopf); color: #fff;
  font-weight: 600; cursor: pointer;
}

/* ---------- Fahrzeugverwaltung ---------- */
.verwaltung { max-width: 1000px; margin: 20px auto; padding: 0 16px; }
.verwaltung table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; }
.verwaltung th, .verwaltung td { padding: 10px; border-bottom: 1px solid var(--linie); text-align: left; font-size: 14px; }
.verwaltung th { background: #eef2f7; font-size: 12px; color: var(--leise); text-transform: uppercase; letter-spacing: .4px; }
.verwaltung input[type=text] { width: 100%; padding: 6px 8px; border: 1px solid var(--linie); border-radius: 6px; }
.verwaltung .mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }
.meldung { background: #ecfdf5; color: #065f46; padding: 10px 14px; border-radius: 8px; }

/* ---------- Handy ---------- */
@media (max-width: 760px) {
  .haupt { grid-template-columns: 1fr; grid-template-rows: 55% 45%; }
  .seite { order: 2; border-right: 0; border-top: 1px solid var(--linie); }
  #karte { order: 1; }
  .kopf { gap: 10px; padding: 0 10px; }
  .kopf nav { gap: 10px; }
}
