:root {
  --petrol: #4E9A93;
  --petrol-dunkel: #3A7570;
  --rahmen: #dfe3e3;
  --grau: #6b7574;
  --hell: #f5f7f7;
  --neu: #2E7D32;
  --vorfuehr: #B8860B;
  --gebraucht: #5a6664;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: #23302e;
  background: var(--hell);
  line-height: 1.5;
}

a { color: var(--petrol-dunkel); }

.topbar {
  background: var(--petrol);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.topbar .marke { font-size: 19px; font-weight: 600; }
.topbar .marke span { opacity: .8; font-weight: 400; font-size: 14px; }
.topbar a { color: #fff; text-decoration: none; }
.topbar .rechts { margin-left: auto; display: flex; gap: 10px; flex-wrap: wrap; }

.inhalt { max-width: 1180px; margin: 0 auto; padding: 20px; }

.btn {
  display: inline-block;
  background: var(--petrol);
  color: #fff;
  border: 0;
  border-radius: 6px;
  padding: 9px 16px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--petrol-dunkel); }
.btn.hell { background: #fff; color: var(--petrol-dunkel); border: 1px solid var(--rahmen); }
.btn.gefahr { background: #fff; color: #b3261e; border: 1px solid #f0c8c4; }
.btn:disabled { opacity: .5; cursor: default; }

.karte {
  background: #fff;
  border: 1px solid var(--rahmen);
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 18px;
}

/* Kennzahlen */
.zahlen { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.zahl {
  background: #fff; border: 1px solid var(--rahmen); border-radius: 10px;
  padding: 12px 18px; min-width: 120px;
}
.zahl b { display: block; font-size: 24px; color: var(--petrol-dunkel); }
.zahl span { font-size: 13px; color: var(--grau); }

/* Filter */
.filter { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter select, .filter input, input, select, textarea {
  font-family: inherit;
  font-size: 16px;
  padding: 8px 10px;
  border: 1px solid var(--rahmen);
  border-radius: 6px;
  background: #fff;
}
.filter input[type=search] { min-width: 220px; flex: 1; }

/* Bestandsliste */
.tscroll { overflow-x: auto; }
table.liste { width: 100%; border-collapse: collapse; background: #fff; min-width: 720px; }
table.liste th, table.liste td {
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rahmen); vertical-align: middle;
}
table.liste th { background: var(--hell); font-size: 13px; color: var(--grau); text-transform: uppercase; letter-spacing: .03em; }
table.liste tr:hover td { background: #fafbfb; }
table.liste img.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 4px; display: block; }
table.liste .kein-bild {
  width: 64px; height: 48px; border-radius: 4px; background: var(--hell);
  border: 1px dashed var(--rahmen); display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--grau);
}

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff; white-space: nowrap;
}
.badge.neu { background: var(--neu); }
.badge.vorfuehr { background: var(--vorfuehr); }
.badge.gebraucht { background: var(--gebraucht); }
.badge.status { background: #fff; color: var(--grau); border: 1px solid var(--rahmen); font-weight: 500; }
.badge.status.verfuegbar { color: var(--neu); border-color: #bcdbbd; }
.badge.status.reserviert { color: var(--vorfuehr); border-color: #e8d5a0; }
.badge.status.verkauft { color: var(--grau); background: var(--hell); }

/* Formular */
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.feld { display: flex; flex-direction: column; gap: 4px; }
.feld label { font-size: 13px; color: var(--grau); font-weight: 600; }
.feld.breit { grid-column: 1 / -1; }
textarea { min-height: 90px; resize: vertical; }

h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 18px; margin: 0 0 12px; }
.hinweis { color: var(--grau); font-size: 14px; }
.warnung {
  background: #fff8e6; border: 1px solid #e8d5a0; border-radius: 8px;
  padding: 10px 14px; font-size: 14px; margin: 12px 0;
}
.fehler {
  background: #fdeceb; border: 1px solid #f0c8c4; border-radius: 8px;
  padding: 10px 14px; font-size: 14px; margin: 12px 0; color: #b3261e;
}

/* Bilder */
.bildreihe { display: flex; gap: 10px; flex-wrap: wrap; }
.bildkachel { position: relative; }
.bildkachel img { width: 150px; height: 112px; object-fit: cover; border-radius: 6px; border: 1px solid var(--rahmen); display: block; }
.bildkachel button {
  position: absolute; top: 4px; right: 4px; border: 0; border-radius: 4px;
  background: rgba(0,0,0,.6); color: #fff; cursor: pointer; padding: 2px 7px; font-size: 13px;
}

/* Anzeigen */
.portal-reiter { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.portal-reiter button {
  border: 1px solid var(--rahmen); background: #fff; border-radius: 999px;
  padding: 7px 15px; cursor: pointer; font-size: 15px; font-family: inherit;
}
.portal-reiter button.aktiv { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.anzeige-feld { margin-bottom: 12px; }
.anzeige-feld label { font-size: 13px; color: var(--grau); font-weight: 600; display: block; margin-bottom: 4px; }
.kopf-zeile { display: flex; gap: 8px; align-items: center; }
.kopf-zeile input, .kopf-zeile textarea { flex: 1; }
.zeichen { font-size: 12px; color: var(--grau); }
.zeichen.zu-lang { color: #b3261e; font-weight: 600; }
.spinner { display: inline-block; font-size: 14px; color: var(--grau); }

@media (max-width: 640px) {
  .inhalt { padding: 14px; }
  .topbar .rechts { width: 100%; }
  .btn { width: 100%; text-align: center; }
  .portal-reiter button, .filter input[type=search] { width: 100%; }
  .bildkachel img { width: 100%; height: 160px; }
  .bildkachel { flex: 1 1 100%; }
}
