:root {
  --bg:        #f0f2f5;
  --karte:     #ffffff;
  --rahmen:    #d8dce3;
  --text:      #1a1d24;
  --blass:     #6b7280;
  --primaer:   #2952a3;
  --primaer-d: #1c3d80;
  --gruen:     #1d8a4e;
  --gruen-d:   #156639;
  --rot:       #c0392b;
  --rot-d:     #962d22;
  --warn-bg:   #fff4d6;
  --warn-bd:   #e8c766;
  --ok-bg:     #d8f0e0;
  --fehler-bg: #fdecea;
  --fehler-tx: #8a1f15;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  line-height: 1.5;
}

/* Topbar */
.topbar {
  background: #1a2233; color: #fff;
  display: flex; justify-content: space-between; align-items: center;
  padding: 0 1.5rem; height: 52px;
}
.nav-links a, .nav-rechts a {
  color: #c3ccda; text-decoration: none; margin-right: 1.2rem;
  font-size: 0.92rem;
}
.nav-links a:hover, .nav-rechts a:hover { color: #fff; }
.nav-rechts { display: flex; align-items: center; gap: 0.3rem; }
.nav-user { color: #8b95a7; font-size: 0.85rem; margin-right: 1rem; }

/* Inhalt */
.inhalt { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.schmal { max-width: 400px; margin: 4rem auto; background: var(--karte);
          padding: 2rem; border-radius: 8px;
          box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
h1 { font-size: 1.5rem; margin: 0 0 1.5rem; }
h2 { font-size: 1.15rem; margin: 1.5rem 0 1rem; }
h3 { font-size: 1rem; margin: 0 0 0.8rem; }

/* Flash */
.flash { padding: 0.8rem 1rem; border-radius: 6px; margin-bottom: 1rem;
         font-size: 0.95rem; }
.flash-ok      { background: var(--ok-bg); }
.flash-warnung { background: var(--warn-bg); border: 1px solid var(--warn-bd); }
.flash-fehler  { background: var(--fehler-bg); color: var(--fehler-tx); }

/* Formulare */
label { display: block; font-weight: 600; margin: 1rem 0 0.4rem; font-size: 0.9rem; }
input[type=text], input[type=password], select {
  width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--rahmen);
  border-radius: 5px; font-size: 0.95rem; font-family: inherit;
}
input:focus, select:focus {
  outline: none; border-color: var(--primaer);
  box-shadow: 0 0 0 3px rgba(41,82,163,0.15);
}
button {
  margin-top: 1rem; padding: 0.6rem 1.1rem; background: var(--primaer);
  color: #fff; border: none; border-radius: 5px; font-size: 0.95rem;
  font-weight: 600; cursor: pointer; font-family: inherit;
}
button:hover { background: var(--primaer-d); }
.button-gruen { background: var(--gruen); }
.button-gruen:hover { background: var(--gruen-d); }
.button-rot { background: var(--rot); }
.button-rot:hover { background: var(--rot-d); }
.button-sekundaer { background: #e4e7ec; color: var(--text); }
.button-sekundaer:hover { background: #d3d7de; }
.link-button { background: none; color: var(--primaer); padding: 0;
               margin: 0; font-weight: 500; font-size: 0.9rem; }
.link-button:hover { background: none; text-decoration: underline; }

/* Dashboard-Karten */
.karten-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
               gap: 1.2rem; }
.stat-karte { background: var(--karte); padding: 1.3rem; border-radius: 8px;
              box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.stat-karte h2 { margin: 0 0 1rem; font-size: 1.1rem; }
.stat-zeile { display: flex; justify-content: space-between; padding: 0.3rem 0;
              font-size: 0.92rem; color: var(--blass); }
.stat-zeile strong { color: var(--text); font-size: 1.05rem; }
.stat-zeile strong.rot { color: var(--rot); }
.karte-link { display: inline-block; margin-top: 0.8rem; color: var(--primaer);
              text-decoration: none; font-size: 0.9rem; }

/* Tabellen */
.kopf-mit-aktion { display: flex; justify-content: space-between; align-items: center; }
.tabelle { width: 100%; border-collapse: collapse; background: var(--karte);
           border-radius: 8px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
.tabelle th { text-align: left; padding: 0.7rem 0.9rem; background: #eef1f5;
              font-size: 0.82rem; text-transform: uppercase; color: var(--blass);
              letter-spacing: 0.03em; }
.tabelle td { padding: 0.7rem 0.9rem; border-top: 1px solid var(--rahmen);
              font-size: 0.92rem; }
.tabelle tr.inaktiv { opacity: 0.5; }
.tabelle.klein td, .tabelle.klein th { font-size: 0.82rem; padding: 0.45rem 0.7rem; }
.leer { text-align: center; color: var(--blass); padding: 2rem; }

/* Filter */
.filter-leiste { display: flex; gap: 0.6rem; margin-bottom: 1.2rem; flex-wrap: wrap; }
.filter-leiste select, .filter-leiste input { width: auto; flex: 0 1 auto; }
.filter-leiste button { margin-top: 0; }

/* Badges */
.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px;
         font-size: 0.78rem; font-weight: 600; }
.badge-grau  { background: #e4e7ec; color: #4b5563; }
.badge-gruen { background: var(--ok-bg); color: var(--gruen-d); }
.badge-warn  { background: var(--warn-bg); color: #8a6d1a; }
.badge-blau  { background: #dde8fb; color: #1c3d80; }

/* Detail-Seite */
.detail-grid { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; }
.detail-haupt .beweis-block { background: var(--karte); padding: 1.3rem;
              border-radius: 8px; margin-bottom: 1.2rem; }
.beweis-block video { width: 100%; border-radius: 5px; background: #000; }
.kennzeichen-foto { max-width: 100%; border-radius: 5px; }
.info-box, .aktions-box { background: var(--karte); padding: 1.3rem;
              border-radius: 8px; margin-bottom: 1.2rem; }
.info-box dl { margin: 0; }
.info-box dt { font-size: 0.78rem; text-transform: uppercase; color: var(--blass);
               margin-top: 0.7rem; }
.info-box dd { margin: 0.1rem 0 0; font-size: 0.95rem; }
.aktions-box form { margin: 0 0 0.8rem; }
.aktions-box button { width: 100%; }
.zurueck-link, .button-sekundaer.zurueck-link { color: var(--primaer);
              text-decoration: none; font-size: 0.9rem; }

/* Formular-Box (Standorte/Benutzer anlegen) */
.formular-box { background: var(--karte); padding: 1.3rem; border-radius: 8px;
                margin-top: 1.5rem; }
.inline-form { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 160px; }
.inline-form button { margin-top: 0; }
.mini-form { display: flex; gap: 0.4rem; margin-top: 0.5rem; }
.mini-form input { font-size: 0.85rem; }
.mini-form button { margin-top: 0; font-size: 0.82rem; padding: 0.4rem 0.7rem; }
.aktionen-zelle { display: flex; flex-direction: column; gap: 0.4rem; }
.aktionen-zelle details summary { cursor: pointer; color: var(--primaer);
                font-size: 0.9rem; }

.hinweis { color: var(--blass); font-size: 0.85rem; margin: 0.5rem 0 0; }

@media (max-width: 800px) {
  .detail-grid { grid-template-columns: 1fr; }
}
