/* Signatur-Werkzeug Bremen 1860
   Farben aus dem Corporate Design: Rot #8d1d39, Tiefrot #5a0728,
   Anthrazit #2b2d32, Weiss #ffffff.
   Bewusst nur Systemschriften – keine Schriften von fremden Servern. */

:root {
  --rot: #8d1d39;
  --tiefrot: #5a0728;
  --anthrazit: #2b2d32;
  --grau: #6f727a;
  --hellgrau: #8b8e96;
  --linie: #e4e5e8;
  --flaeche: #f6f6f7;
  --weiss: #ffffff;
  --gruen: #1f7a4d;
  --schrift: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--flaeche);
  color: var(--anthrazit);
  font: 15px/1.55 var(--schrift);
  -webkit-text-size-adjust: 100%;
}

/* ---------- Kopf ---------- */

.kopf {
  background: var(--rot);
  color: var(--weiss);
  border-bottom: 6px solid var(--tiefrot);
}
.kopf-innen {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 18px;
}
.marke { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.marke-name {
  font-size: 22px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase;
}
.marke-zusatz {
  font-size: 12px; letter-spacing: 2px; text-transform: uppercase;
  color: rgba(255,255,255,.72);
}
.kopf-notiz { margin: 6px 0 0; font-size: 14px; color: rgba(255,255,255,.82); }

/* ---------- Reiter ---------- */

.reiter {
  display: flex; gap: 2px; flex-wrap: wrap;
  background: var(--anthrazit);
  padding: 0 24px;
}
.reiter-knopf {
  appearance: none; border: 0; cursor: pointer;
  background: transparent; color: rgba(255,255,255,.7);
  font: 600 13px/1 var(--schrift); letter-spacing: .6px;
  padding: 14px 16px; border-bottom: 3px solid transparent;
}
.reiter-knopf:hover { color: #fff; }
.reiter-knopf.ist-aktiv { color: #fff; border-bottom-color: var(--rot); background: rgba(255,255,255,.06); }

/* ---------- Aufbau ---------- */

.huelle { max-width: 1240px; margin: 0 auto; padding: 22px 24px 40px; }
.tab { display: none; }
.tab.ist-aktiv { display: block; }

.raster { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 20px; align-items: start; }
.raster-schmal { grid-template-columns: 380px minmax(0, 1fr); }
@media (max-width: 900px) { .raster, .raster-schmal { grid-template-columns: 1fr; } }

.spalte-links, .spalte-rechts { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.feldgruppe {
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: 4px;
  padding: 18px 20px 20px;
}
.feldgruppe h2 {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 700; letter-spacing: 1.6px; text-transform: uppercase;
  color: var(--rot);
}
.karten-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.karten-kopf h2 { margin: 0; }
.karten-kopf-eng { margin-bottom: 6px; }

.hinweis { margin: 0 0 12px; font-size: 13px; line-height: 1.5; color: var(--grau); }
.hinweis:last-child { margin-bottom: 0; }

code {
  font: 12px/1.4 var(--mono);
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 3px;
  padding: 1px 4px;
}

.liste { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--grau); }
.liste li { margin-bottom: 7px; }

/* ---------- Variantenliste ---------- */

.modellwahl { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-size: 13.5px; }
.modellwahl label { display: flex; align-items: center; gap: 8px; cursor: pointer; }

.variantenliste { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.variantenliste button {
  width: 100%; text-align: left; cursor: pointer;
  background: var(--weiss); border: 1px solid var(--linie); border-left: 3px solid var(--linie);
  border-radius: 3px; padding: 9px 12px; font: 14px/1.35 var(--schrift); color: var(--anthrazit);
}
.variantenliste button:hover { border-color: #c9cace; border-left-color: var(--rot); }
.variantenliste button.ist-aktiv {
  border-color: var(--rot); border-left-color: var(--rot); background: #fdf5f7;
}
.variantenliste .v-titel { display: block; font-weight: 600; }
.variantenliste .v-notiz { display: block; font-size: 12px; color: var(--hellgrau); margin-top: 2px; }

/* ---------- Formularfelder ---------- */

.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 12px; }

.feld { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.feld-oben { margin-top: 14px; margin-bottom: 0; }
.feld > span, .felder label > span {
  font-size: 12px; font-weight: 600; letter-spacing: .4px; color: var(--grau);
}
.felder label { display: flex; flex-direction: column; gap: 5px; }

input[type="text"], select, textarea:not(.code) {
  font: 14px/1.4 var(--schrift);
  color: var(--anthrazit); background: var(--weiss);
  border: 1px solid #ced0d4; border-radius: 3px;
  padding: 8px 10px; width: 100%;
}
input[type="text"]:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(141,29,57,.35); outline-offset: 1px; border-color: var(--rot);
}
.ankreuz { display: flex; gap: 9px; align-items: flex-start; font-size: 13.5px; color: var(--grau); margin-top: 12px; }
.ankreuz input { margin-top: 3px; }

/* ---------- Knöpfe ---------- */

.knopf {
  appearance: none; cursor: pointer;
  background: var(--rot); color: var(--weiss); border: 1px solid var(--rot);
  border-radius: 3px; padding: 7px 14px;
  font: 600 13px/1.2 var(--schrift); letter-spacing: .3px;
}
.knopf:hover { background: var(--tiefrot); border-color: var(--tiefrot); }
.knopf-still { background: var(--weiss); color: var(--rot); }
.knopf-still:hover { background: #fdf5f7; color: var(--tiefrot); }
.knopf.ist-fertig { background: var(--gruen); border-color: var(--gruen); color: #fff; }
.knopfreihe { display: flex; gap: 8px; flex-wrap: wrap; }

.schalter { display: inline-flex; border: 1px solid var(--linie); border-radius: 3px; overflow: hidden; }
.schalter button {
  appearance: none; cursor: pointer; border: 0; background: var(--weiss);
  color: var(--grau); font: 600 12px/1 var(--schrift); padding: 8px 12px;
}
.schalter button + button { border-left: 1px solid var(--linie); }
.schalter button.ist-aktiv { background: var(--rot); color: var(--weiss); }

/* ---------- Vorschau ---------- */

.buehne {
  background: var(--flaeche);
  border: 1px solid var(--linie);
  border-radius: 3px;
  padding: 18px;
  display: flex; justify-content: center;
  overflow: auto;
}
.buehne iframe {
  border: 0; background: var(--weiss); width: 100%; max-width: 660px; min-height: 220px;
  box-shadow: 0 1px 3px rgba(0,0,0,.09);
}
.buehne.ist-mobil iframe { width: 375px; max-width: 375px; flex: 0 0 375px; }

/* ---------- Code ---------- */

.code {
  display: block; width: 100%; min-height: 190px; resize: vertical;
  font: 12px/1.55 var(--mono);
  color: #e9eaec; background: var(--anthrazit);
  border: 1px solid #1d1f23; border-radius: 3px;
  padding: 12px 14px; white-space: pre; overflow: auto;
}
.code-hoch { min-height: 430px; }
.code-klein { min-height: 92px; }

/* ---------- Ablage / Tabelle ---------- */

.ablage {
  border: 2px dashed #ccced2; border-radius: 4px;
  padding: 22px; text-align: center; background: var(--flaeche);
}
.ablage.ist-bereit { border-color: var(--rot); background: #fdf5f7; }
.ablage p { margin: 0 0 6px; }
.verweis { color: var(--rot); font-weight: 600; text-decoration: underline; cursor: pointer; }

.uebersicht { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.kachel {
  border: 1px solid var(--linie); border-left: 3px solid var(--rot); border-radius: 3px;
  padding: 9px 14px; min-width: 128px; background: var(--weiss);
}
.kachel b { display: block; font-size: 21px; line-height: 1.2; }
.kachel span { font-size: 12px; color: var(--grau); }
.kachel.ist-gut { border-left-color: var(--gruen); }

.tabellenrahmen { overflow-x: auto; border: 1px solid var(--linie); border-radius: 3px; }
.tabelle { border-collapse: collapse; width: 100%; font-size: 13px; }
.tabelle th, .tabelle td { padding: 7px 10px; text-align: left; border-bottom: 1px solid var(--linie); white-space: nowrap; }
.tabelle th { background: var(--flaeche); font-size: 11px; letter-spacing: .8px; text-transform: uppercase; color: var(--grau); }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .fehlt { color: var(--rot); font-weight: 600; }
.tabelle .da { color: var(--hellgrau); }

/* ---------- Fuss ---------- */

.fuss {
  max-width: 1240px; margin: 0 auto; padding: 0 24px 34px;
  font-size: 12.5px; color: var(--hellgrau);
}

.klein { display: inline-block; margin-top: 3px; font-size: 12px; font-style: normal; color: var(--hellgrau); }

/* Warnung, wenn der Regel-Text die Exchange-Grenze von 5000 Zeichen sprengt */
.hinweis.ist-zu-lang { color: #8d1d39; font-weight: bold; }

/* Archiv-Schalter und archivierte Vorlagen in der Liste */
.modellwahl .archivwahl { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--linie, #e4e5e8); color: var(--grau, #6f727a); }
.variantenliste li.ist-archiv button { opacity: .72; }
.variantenliste li.ist-archiv button.ist-aktiv { opacity: 1; }

/* Reiter 4 · Aktionsblock: Datumsfelder nebeneinander */
.feld-doppelt { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.feld-doppelt .feld { margin: 0; }

/* Das hidden-Attribut soll auch gegen display:flex/grid der Klassen gewinnen */
[hidden] { display: none !important; }

/* Reiter 5 · Bilder */
.bilderliste { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.bilderliste-klein { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.bild { border: 1px solid var(--linie); border-radius: 3px; padding: 10px; background: var(--weiss); display: flex; flex-direction: column; gap: 6px; }
.bild-vorschau { display: block; background: var(--flaeche); border: 1px solid var(--linie); }
.bild-vorschau img { display: block; width: 100%; height: auto; max-height: 160px; object-fit: contain; }
.bilderliste-klein .bild-vorschau img { max-height: 120px; }
.bild-name { font-size: 12.5px; font-weight: bold; word-break: break-all; }
.bild-mass { margin: 0; font-size: 12px; }
.bild-knoepfe { flex-wrap: wrap; gap: 6px; }
.knopf-klein { padding: 4px 9px; font-size: 12px; }

/* Reiter 6 · Regelplan */
.tabelle tr.ist-abgelaufen td { color: var(--grau); }
.tabelle td.ist-zu-lang { color: #8d1d39; font-weight: bold; }
.knopfreihe a.knopf { text-decoration: none; display: inline-block; }

/* Anmeldung und Kopfzeile */
.kopf-innen { position: relative; }
.kopf-benutzer { position: absolute; right: 0; top: 0; display: flex; align-items: center; gap: 12px; font-size: 13px; color: rgba(255,255,255,.85); }
.knopf-hell { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); }
.knopf-hell:hover { background: rgba(255,255,255,.12); }
.huelle-schmal { max-width: 440px; margin: 40px auto; }
body.anmeldung .feld { margin-bottom: 12px; }
@media (max-width: 700px) { .kopf-benutzer { position: static; margin-top: 10px; } }
