/* Login, Registrierung, Konto – gleiche Farben wie die Bedienoberfläche. */
:root {
  --bg: #f7f7f5; --panel: #fff; --ink: #1a1a18; --muted: #6b6b66;
  --line: #e2e2dd; --accent: #2f6f4f; --accent-ink: #fff; --err: #b3261e;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16171a; --panel: #1e2024; --ink: #e8e8e4; --muted: #9a9a94;
    --line: #2e3136; --accent: #4a9d73; --accent-ink: #0d0f11; --err: #f2867c;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 12px rgba(0,0,0,.2);
  }
}
* { box-sizing: border-box; }
/* Platz für die Scrollleiste immer freihalten – sonst springt der Inhalt
   zwischen kurzen und langen Seiten um deren Breite. */
html { scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.55 ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
}
a { color: var(--accent); }
.narrow { max-width: 420px; margin: 0 auto; padding: 56px 16px 64px; }
/* Alle Seiten nach dem Login: gleiche Breite, gleiche Kopfzeile (auch /werkzeug). */
.wide { max-width: 1000px; margin: 0 auto; padding: 32px 20px 64px; }
.brand { display: block; width: 140px; height: auto; margin: 0 0 22px; }
@media (prefers-color-scheme: dark) { .brand { filter: invert(1); } }
h1 { font-size: 21px; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted);
     margin: 30px 0 10px; font-weight: 600; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
        padding: 22px; box-shadow: var(--shadow); }
label.f { display: block; font-size: 13px; font-weight: 500; margin: 0 0 14px; }
label.f input { display: block; width: 100%; margin-top: 5px; padding: 10px 12px; font: inherit;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
label.f input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12px; }
label.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; margin: 4px 0 18px; }
label.check input { margin-top: 3px; }
button { font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 0;
  background: var(--accent); color: var(--accent-ink); cursor: pointer; }
button.full { width: 100%; }
button.ghost { background: none; color: var(--accent); border: 1px solid var(--line); font-weight: 500; }
button:disabled { opacity: .5; cursor: default; }
.err { color: var(--err); font-size: 13px; min-height: 1.2em; margin: 0 0 12px; }
.ok { color: var(--accent); font-size: 13px; min-height: 1.2em; margin: 0 0 12px; }
.alt { text-align: center; font-size: 14px; margin-top: 18px; color: var(--muted); }
.legal { font-size: 12px; color: var(--muted); margin-top: 28px; text-align: center; }
.legal a { color: var(--muted); }

.top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 26px;
       min-height: 46px; }
.top .brand { margin: 0; }
.top nav { display: flex; gap: 14px; align-items: center; font-size: 14px; flex-wrap: wrap; justify-content: flex-end; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; overflow-wrap: anywhere; }
.meter { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 10px 0 6px; }
.meter > div { height: 100%; background: var(--accent); }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.plan { border: 1px solid var(--line); border-radius: 10px; padding: 16px; font-size: 14px; }
.plan.current { border-color: var(--accent); }
.plan h3 { margin: 0 0 6px; font-size: 16px; }
.plan ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px;
       background: var(--accent); color: var(--accent-ink); margin-left: 6px; vertical-align: 2px; }

/* Ablauf in drei Schritten (Projektseite) */
.steps { list-style:none; counter-reset:step; display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:10px; padding:0; margin:0 0 22px; }
.steps li { counter-increment:step; background:var(--panel); border:1px solid var(--line); border-radius:10px;
  padding:12px 14px 12px 46px; position:relative; font-size:14px; }
.steps li::before { content:counter(step); position:absolute; left:14px; top:12px; width:22px; height:22px; border-radius:50%;
  background:var(--accent); color:var(--accent-ink); font-size:13px; font-weight:700; display:grid; place-items:center; }
.steps li span { display:block; color:var(--muted); font-size:13px; margin-top:2px; }
/* Prüfungen als Zeilen statt Tabelle – auf dem Handy untereinander */
.run { display:flex; justify-content:space-between; align-items:center; gap:10px 16px; flex-wrap:wrap;
  padding:12px 0; border-top:1px solid var(--line); }
a.btn { display:inline-block; text-decoration:none; font-weight:600; font-size:14px; padding:8px 14px; border-radius:8px;
  background:var(--accent); color:var(--accent-ink); }
a.btn.ghost { background:none; color:var(--accent); border:1px solid var(--line); font-weight:500; }
.action { max-width:320px; }

.single input[type=url] { flex: 1; min-width: 220px; padding: 8px 12px; font: inherit; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }

/* Navigation, Projekte, Verwaltung */
.top nav a { text-decoration: none; font-weight: 500; }
.top nav a[aria-current="page"] { color: var(--ink); }
.top nav .who { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
/* Handy: Logo oben, Navigation darunter in einer Zeile, ohne E-Mail. */
@media (max-width: 640px) {
  .top { flex-direction: column; align-items: flex-start; gap: 14px; }
  .top nav { justify-content: flex-start; }
  .top nav .who { display: none; }
}
button.small { padding: 6px 12px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.card + .card { margin-top: 14px; }
.card h3 { margin: 0 0 4px; font-size: 17px; }
.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px;
        border: 1px solid var(--line); color: var(--muted); white-space: nowrap; }
.pill.ok { border-color: var(--accent); color: var(--accent); }
.pill.warn { border-color: #c2611c; color: #c2611c; }
.pill.free { border-style: dashed; }
.band-gruen { color: #2f6f4f; } .band-gelb { color: #8a6d1f; } .band-orange { color: #c2611c; } .band-rot { color: #b3261e; }
@media (prefers-color-scheme: dark) {
  .band-gruen { color: #4a9d73; } .band-gelb { color: #d9c46a; } .band-orange { color: #e8a765; } .band-rot { color: #f2867c; }
}
.tablewrap { overflow-x: auto; }
table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th { text-align: left; font-size: 12px; font-weight: 600; color: var(--muted); padding: 6px 8px;
                border-bottom: 1px solid var(--line); white-space: nowrap; }
table.list td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; }
.addr { white-space: pre-line; font-size: 13px; }
details.box { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-top: 12px; background: var(--panel); }
details.box summary { cursor: pointer; font-weight: 600; font-size: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 14px; }
label.f select, label.f textarea { display: block; width: 100%; margin-top: 5px; padding: 9px 12px; font: inherit;
  color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
label.f textarea { min-height: 70px; resize: vertical; }
.notice { background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; padding: 12px 16px;
          font-size: 14px; margin: 0 0 16px; }
/* Inhalt erst zeigen, wenn alle Daten da sind – dann auf einmal, ohne Nachrutschen. */
.loading { animation: show-anyway 0s 2s forwards; visibility: hidden; }
@keyframes show-anyway { to { visibility: visible; } }
.empty { padding: 22px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }

/* Admin: Aktionen als kleine Knöpfe in einer Zeile; aufgeklappt volle Breite. */
.actions { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 4px; align-items:flex-start; }
.actions > details.box { margin:0; padding:0; border:0; background:none; }
.actions > details.box > summary { list-style:none; display:inline-block; font-size:13px; font-weight:500;
  padding:5px 12px; border:1px solid var(--line); border-radius:8px; color:var(--accent); background:var(--panel); }
.actions > details.box > summary::-webkit-details-marker { display:none; }
.actions > details.box[open] { flex-basis:100%; border:1px solid var(--line); border-radius:10px; padding:10px 14px; background:var(--panel); }
.actions > details.box[open] > summary { border:0; padding:0; background:none; color:var(--ink); font-weight:600; }

.linkbtn { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; }
.ok, .err { overflow-wrap: anywhere; }

/* Kundenansicht durch einen Admin – unübersehbar, oben fixiert */
.impersonation { position: sticky; top: 0; z-index: 30; display: flex; gap: 12px; align-items: center; justify-content: center;
  flex-wrap: wrap; padding: 9px 16px; background: #8a4b00; color: #fff; font-size: 14px; }
.impersonation button { background: #fff; color: #8a4b00; padding: 5px 12px; font-size: 13px; }

/* Fußzeile im Portal: Kontakt, Impressum, Datenschutz */
.portalfoot { max-width:1000px; margin:48px auto 24px; padding:14px 16px 0; border-top:1px solid var(--line, #e2e2dd);
  display:flex; justify-content:space-between; gap:12px; flex-wrap:wrap; font-size:13px; color:var(--muted, #6b6b66); }
.portalfoot a { color:inherit; }
