/* Farben aus dem ND-Logo: Petrol #458692, Limette #cedb2f */
:root {
  --petrol: #458692;
  --petrol-dunkel: #2f6f7a;
  --limette: #cedb2f;
  --text: #1f2d30;
  --text-leise: #55686c;
  --grund: #eef3f4;
  --flaeche: #ffffff;
  --linie: #d5e0e2;
  --gefahr: #a8321f;
  --radius: 8px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--grund);
  color: var(--text);
  font: 17px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.innen { width: 100%; max-width: 1100px; margin: 0 auto; padding: 0 20px; }
.oeffentlich .innen { max-width: 640px; }

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

h1, h2 { font-family: Georgia, "Times New Roman", serif; color: var(--petrol-dunkel); line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.7rem; margin: 0 0 .6em; }
h2 { font-size: 1.2rem; margin: 0 0 .6em; }
p { margin: 0 0 1em; }
code { background: var(--grund); padding: 1px 5px; border-radius: 4px; font-size: .9em; }

/* Kopf und Fuß */
.kopf { background: var(--flaeche); border-bottom: 4px solid var(--limette); }
.kopf .innen { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 14px; }
.logo { display: flex; align-items: center; gap: 18px; line-height: 0; min-width: 0; }
.logo img { width: 300px; min-width: 0; flex: 0 1 auto; height: auto; }
.logo .wappen { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; text-decoration: none; }
.logo .wappen img { width: 40px; }
.logo .wappen span { font: 600 .72rem/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--petrol-dunkel); }
.logo { text-decoration: none; }
.admin .logo img { width: 220px; }
.admin .logo .wappen img { width: 30px; }
.admin .logo .wappen span { font-size: .62rem; }

.nav { display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 3px solid transparent; font-weight: 600; }
.nav a[aria-current="page"] { border-bottom-color: var(--limette); color: var(--text); }
.nav form { margin: 0; }

main.innen { flex: 1; padding-top: 32px; padding-bottom: 48px; }
.fuss { color: var(--text-leise); font-size: .85rem; padding: 18px 0 28px; }

/* Flächen */
.karte { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 24px; margin: 0 0 24px; }
.karte > :last-child { margin-bottom: 0; }
.schmal { max-width: 560px; margin-left: auto; margin-right: auto; }

.zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; margin: 0 0 16px; }
.zeile h1 { margin: 0; }
.zeile form { margin: 0; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin: 0 0 32px; }
.kachel { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 20px; }
.kachel strong { display: block; font-size: 2rem; line-height: 1.1; color: var(--petrol-dunkel); font-variant-numeric: tabular-nums; }
.kachel span { color: var(--text-leise); font-size: .9rem; }

.zweispaltig { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 900px) { .zweispaltig { grid-template-columns: minmax(0, 1fr); } }
.vorschau { position: sticky; top: 16px; }
.vorschau iframe { width: 100%; height: 70vh; min-height: 420px; border: 1px solid var(--linie); border-radius: 6px; background: var(--grund); }
@media (max-width: 900px) { .vorschau { position: static; } }

/* Formulare */
label { display: block; font-weight: 600; margin: 0 0 6px; }
input[type="text"], input[type="email"], input[type="password"], textarea {
  display: block; width: 100%; margin: 0 0 18px; padding: 11px 12px;
  font: inherit; color: var(--text); background: #fff;
  border: 1px solid #9fb3b7; border-radius: 6px;
}
textarea { resize: vertical; line-height: 1.5; }
input:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 3px solid var(--limette); outline-offset: 2px; border-color: var(--petrol-dunkel);
}

.haken { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; margin: 0 0 20px; cursor: pointer; }
.haken input { flex: none; width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--petrol-dunkel); }

button, .knopf {
  display: inline-block; padding: 11px 22px; min-height: 44px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
  color: #fff; background: var(--petrol-dunkel); border: 2px solid var(--petrol-dunkel); border-radius: 6px;
}
button:hover, .knopf:hover { background: #245861; border-color: #245861; color: #fff; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.zweit, .knopf.zweit { background: #fff; color: var(--petrol-dunkel); }
button.zweit:hover, .knopf.zweit:hover { background: var(--grund); color: var(--petrol-dunkel); }
button.gefahr { background: var(--gefahr); border-color: var(--gefahr); }
button.gefahr:hover { background: #862717; border-color: #862717; }
button.link { background: none; border: 0; padding: 6px 0; min-height: 0; color: var(--petrol-dunkel); font-weight: 600; text-decoration: underline; }
button.link:hover { background: none; color: var(--text); }

.in-zeile { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.in-zeile label { flex-basis: 100%; margin: 0; }
.in-zeile input { flex: 1 1 220px; margin: 0; }

.unsichtbar { position: absolute; left: -9999px; width: 1px; height: 1px; min-height: 0; padding: 0; border: 0; overflow: hidden; }
.nicht-ausfuellen { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.klein { font-size: .85rem; color: var(--text-leise); }
form + .klein { margin-top: 18px; }

.hinweis { background: #f4f8d6; border-left: 5px solid var(--limette); border-radius: 4px; padding: 12px 16px; }
.hinweis.fehler { background: #fbe9e5; border-left-color: var(--gefahr); }
.hinweis.warnung { background: #fff4d6; border-left-color: #d9a300; }

/* Tabellen */
.tabelle-rahmen { overflow-x: auto; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); margin: 0 0 24px; }
.karte .tabelle-rahmen { margin-top: 16px; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--linie); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-leise); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }
td.aktionen { white-space: nowrap; text-align: right; }
td.aktionen form, td.aktionen details { display: inline-block; margin: 0 0 0 14px; vertical-align: top; }

.marke { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .8rem; font-weight: 600; background: var(--grund); color: var(--text-leise); white-space: nowrap; }
.marke.aktiv, .marke.versendet, .marke.gesendet { background: #e3f0d0; color: #2f5a14; }
.marke.versand, .marke.pending, .marke.offen { background: #fff4d6; color: #6f5200; }
.marke.fehler, .marke.bounce, .marke.gestoppt { background: #fbe9e5; color: var(--gefahr); }

details.bestaetigung summary { cursor: pointer; color: var(--gefahr); font-weight: 600; padding: 6px 0; }
details.bestaetigung form { margin: 10px 0 0; }
details.bestaetigung.karte { padding: 14px 24px; }

.daten { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; margin: 0 0 16px; }
.daten dt { color: var(--text-leise); }
.daten dd { margin: 0; font-variant-numeric: tabular-nums; }

/* Texte bearbeiten */
.textfeld { margin: 0 0 22px; }
.textfeld:last-child { margin-bottom: 0; }
.textfeld-kopf { display: flex; align-items: baseline; gap: 4px 12px; flex-wrap: wrap; margin: 0 0 6px; }
.textfeld-kopf label { margin: 0 auto 0 0; }
.textfeld input[type="text"], .textfeld textarea { margin-bottom: 6px; }
.textfeld .klein { margin: 0; }
[aria-invalid="true"] { border-color: var(--gefahr) !important; border-width: 2px !important; }
.feldfehler { color: var(--gefahr); font-weight: 600; margin: 0 0 6px; }
.speicherleiste { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--grund) 70%, transparent); }

/* Symbol-Knopf (Abmelden in der Navigation) */
button.symbol { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 0; padding: 0; background: none; border: 0; border-radius: 6px; color: var(--petrol); }
button.symbol:hover { background: var(--grund); color: var(--petrol-dunkel); }

/* Aktionen in Listen und Rückfragen */
td.aktionen a { display: inline-block; margin-left: 16px; padding: 4px 0; font-weight: 600; }
a.gefahr { color: var(--gefahr); }
.knopfreihe { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 20px; }
