/* Karvi - klares, vertrauenswuerdiges Grunddesign in Petrol + Bernstein */
:root {
  --petrol: #17697a;
  --petrol-dunkel: #0f4d5a;
  --bernstein: #f2a83b;
  --hintergrund: #f1f6f6;
  --karte: #ffffff;
  --tinte: #1e2f35;
  --tinte-hell: #64797f;
  --linie: #d9e4e4;
  --gruen: #4d8b58;
  --rot: #bb544e;
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, "Segoe UI", sans-serif;
  background: var(--hintergrund);
  color: var(--tinte);
  line-height: 1.55;
}
a { color: var(--petrol); }

/* Kopfzeile */
header.kopf {
  background: var(--karte);
  border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 1100;
}
.kopf-innen {
  max-width: 1100px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.logo { font-size: 22px; font-weight: 800; text-decoration: none; color: var(--tinte); }
.logo span { color: var(--petrol); }
.logo .logo-ort {
  font-size: 12px; font-weight: 700; color: var(--petrol-dunkel);
  background: #e3eef0; border-radius: 999px; padding: 2px 8px; vertical-align: middle;
}
.kopf-nav { margin-left: auto; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.kopf-nav a { text-decoration: none; color: var(--tinte-hell); font-weight: 600; font-size: 15px; }
.kopf-nav a.aktiv, .kopf-nav a:hover { color: var(--petrol-dunkel); }

.inhalt { max-width: 1100px; margin: 0 auto; padding: 20px 16px 60px; }

/* Held */
.held {
  background: linear-gradient(135deg, #d6e8ea, #9cc4c9);
  border-radius: var(--radius);
  padding: 38px 28px; margin-bottom: 24px;
}
.held h1 { margin: 0 0 8px; font-size: clamp(26px, 4.5vw, 40px); }
.held p { margin: 0; font-size: 17px; color: #2c4a50; max-width: 680px; }

/* Formulare */
input, select, textarea, button {
  font: inherit; color: inherit;
  border: 1px solid var(--linie); border-radius: 10px;
  padding: 9px 12px; background: var(--karte);
}
textarea { width: 100%; resize: vertical; }
label.feld { display: block; margin: 10px 0 4px; font-weight: 600; font-size: 14px; }
button.primaer {
  background: var(--petrol); color: #fff; border: none;
  font-weight: 700; cursor: pointer; padding: 11px 20px;
}
button.primaer:hover { background: var(--petrol-dunkel); }
button.bernstein {
  background: var(--bernstein); color: #4a3312; border: none;
  font-weight: 700; cursor: pointer; padding: 11px 20px;
}
button.bernstein:hover { filter: brightness(.95); }
button.leise {
  background: transparent; border: 1px solid var(--linie);
  cursor: pointer; color: var(--tinte-hell);
}
button:disabled { opacity: .5; cursor: not-allowed; }

.suchleiste {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: end;
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 12px; margin-bottom: 20px;
}
.suchleiste label { display: flex; flex-direction: column; gap: 3px;
  font-size: 12.5px; font-weight: 600; color: var(--tinte-hell); }
.suchleiste input, .suchleiste select { min-width: 120px; }
.suchleiste input[name=stadt] { min-width: 170px; }

/* Karten-Raster */
.raster {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.karte-fahrzeug {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); overflow: hidden;
  text-decoration: none; color: inherit; display: block;
  transition: transform .12s ease, box-shadow .12s ease;
}
.karte-fahrzeug:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(15,77,90,.14); }
.karte-fahrzeug img { width: 100%; height: 165px; object-fit: cover; display: block; }
.karte-fahrzeug .karte-text { padding: 12px 14px; }
.karte-fahrzeug h3 { margin: 0 0 4px; font-size: 16px; }
.karte-fahrzeug .ort { color: var(--tinte-hell); font-size: 14px; margin: 0; }
.karte-fahrzeug .preis { margin: 8px 0 0; font-weight: 800; }
.karte-fahrzeug .preis small { font-weight: 400; color: var(--tinte-hell); }

.abzeichen-reihe { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.abzeichen {
  font-size: 12.5px; background: #e3eef0; color: #33565e;
  border-radius: 999px; padding: 3px 10px;
}

/* Landkarte */
#landkarte { height: 420px; border-radius: var(--radius); border: 1px solid var(--linie); margin-bottom: 24px; }
#standort-karte { height: 300px; border-radius: 10px; border: 1px solid var(--linie); }

/* Boxen */
.box {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 18px; margin-bottom: 18px;
}
.box h2, .box h3 { margin-top: 0; }
.zwei-spalten { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; align-items: start; }
@media (max-width: 820px) { .zwei-spalten { grid-template-columns: 1fr; } }

.preiszeile { display: flex; justify-content: space-between; margin: 4px 0; font-size: 15px; }
.preiszeile.gesamt { font-weight: 800; border-top: 1px solid var(--linie); padding-top: 8px; margin-top: 8px; }

.hinweis { background: #fdf3df; border-radius: 10px; padding: 10px 14px; font-size: 14px; color: #7c5b1e; }
.fehler { background: #f7e3e2; color: var(--rot); border-radius: 10px; padding: 10px 14px; font-size: 14px; }
.erfolg { background: #e5efe2; color: var(--gruen); border-radius: 10px; padding: 10px 14px; font-size: 14px; }

.status-punkt { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.status-bezahlt { background: #e5efe2; color: var(--gruen); }
.status-zahlung_offen { background: #fdf0d7; color: #9a7420; }
.status-storniert { background: #eef0ec; color: var(--tinte-hell); }
.status-abgeschlossen { background: #e3ecf2; color: #4f7f95; }
.status-angefragt { background: #ece7f4; color: #6b5f9e; }
.status-abgelehnt { background: #f7e3e2; color: var(--rot); }
.status-laufend { background: #dff0f2; color: var(--petrol-dunkel); }

/* Pruef-Status (Versicherung, Fuehrerschein) */
.pruef-fehlt { background: #f7e3e2; color: var(--rot); }
.pruef-eingereicht { background: #fdf0d7; color: #9a7420; }
.pruef-geprueft { background: #e5efe2; color: var(--gruen); }

/* Vertrauen: Abzeichen + Benachrichtigungs-Glocke */
.abzeichen-ok {
  font-size: 12.5px; background: #e5efe2; color: var(--gruen);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.glocke-halter { position: relative; }
.glocke {
  background: none; border: none; cursor: pointer;
  font-size: 18px; position: relative; padding: 2px 6px;
}
.glocke-zahl {
  position: absolute; top: -4px; right: -4px;
  background: var(--rot); color: #fff; border-radius: 999px;
  font-size: 11px; padding: 1px 5px; font-weight: 700;
}
.glocke-panel {
  position: absolute; right: 0; top: 34px; width: 310px;
  max-height: 360px; overflow-y: auto;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 77, 90, .18); padding: 6px 14px; z-index: 1200;
}
.glocke-panel p {
  margin: 0; padding: 9px 0; font-size: 14px;
  border-bottom: 1px solid var(--linie);
}
.glocke-panel p:last-child { border-bottom: none; }
.glocke-panel a { text-decoration: none; }
.glocke-panel .wann { display: block; font-size: 12px; color: var(--tinte-hell); }

/* Vermieter-Cockpit: aufklappbare Bereiche + Foto-Verwaltung */
details.verwaltung { border-top: 1px solid var(--linie); margin-top: 10px; padding-top: 8px; }
details.verwaltung summary { cursor: pointer; font-weight: 600; font-size: 14.5px; color: var(--tinte-hell); }
.foto-verwaltung { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.foto-verwaltung figure { margin: 0; width: 130px; }
.foto-verwaltung img { width: 130px; height: 88px; object-fit: cover; border-radius: 8px; display: block; }
.foto-verwaltung figcaption { display: flex; gap: 4px; margin-top: 4px; }
.foto-verwaltung button { font-size: 12px; padding: 3px 8px; }

/* Uebergabe-Protokoll + Zugangscode */
.protokoll {
  border-left: 3px solid var(--petrol); background: #f3f8f9;
  border-radius: 0 10px 10px 0; padding: 10px 14px; margin: 8px 0; font-size: 14px;
}
.zugangscode {
  font-size: 34px; font-weight: 800; letter-spacing: 8px; text-align: center;
  background: var(--petrol-dunkel); color: #fff; border-radius: 12px;
  padding: 16px; margin: 10px 0;
}

/* Chat */
.chat-verlauf { max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; padding: 4px 0; }
.blase { max-width: 75%; padding: 8px 12px; border-radius: 14px; font-size: 14.5px; }
.blase.ich { align-self: flex-end; background: var(--petrol); color: #fff; }
.blase.andere { align-self: flex-start; background: #e3eef0; }
.blase .wer { display: block; font-size: 11.5px; opacity: .75; margin-bottom: 2px; }

/* App-Installations-Knopf (erscheint nur, wenn der Browser installieren kann) */
#install-knopf {
  position: fixed; bottom: 18px; right: 18px; z-index: 1300;
  background: var(--petrol); color: #fff; border: none; cursor: pointer;
  font-weight: 700; font-size: 15px; padding: 12px 18px; border-radius: 999px;
  box-shadow: 0 6px 20px rgba(15, 77, 90, .3);
}
#install-knopf:hover { background: var(--petrol-dunkel); }

footer#fusszeile { border-top: 1px solid var(--linie); margin-top: 40px; background: var(--karte); }
#fusszeile .fuss-innen {
  max-width: 1100px; margin: 0 auto; padding: 16px;
  font-size: 13.5px; color: var(--tinte-hell);
}
#fusszeile a { color: var(--tinte-hell); }

.sterne { color: #d9a13c; letter-spacing: 2px; }
.antwort {
  display: block; margin-top: 6px; padding: 8px 12px;
  background: #eef4f5; border-left: 3px solid var(--petrol);
  border-radius: 0 8px 8px 0; font-size: 14px;
}
.fussnote { color: var(--tinte-hell); font-size: 13.5px; }
.galerie { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-bottom: 18px; }
.galerie img { width: 100%; height: 180px; object-fit: cover; border-radius: 10px; }
.galerie img:first-child { grid-column: 1 / -1; height: 320px; }

/* Admin-Tabellen */
.admin-liste { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.admin-liste th, .admin-liste td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.admin-liste th { color: var(--tinte-hell); font-size: 13px; }
