:root {
  --accent: #0d7a5f;
  --accent-dark: #0a5f4a;
  --bg: #f6f8f7;
  --card: #ffffff;
  --text: #1c2422;
  --muted: #64716d;
  --danger: #b3261e;
  --border: #dde5e2;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
header {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 12px 20px; display: flex; align-items: baseline; gap: 14px;
}
.logo { font-weight: 700; font-size: 1.15rem; color: var(--accent); text-decoration: none; }
.praxisname { color: var(--muted); font-size: .95rem; }
nav {
  background: var(--card); border-bottom: 1px solid var(--border);
  padding: 8px 20px; display: flex; gap: 18px; flex-wrap: wrap; align-items: center;
}
nav a { color: var(--text); text-decoration: none; font-size: .95rem; }
nav a:hover { color: var(--accent); }
nav .primary-link { color: var(--accent); font-weight: 600; }
main { max-width: 860px; margin: 0 auto; padding: 24px 20px 60px; }
footer { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px; }
footer a { color: var(--muted); }
h1 { font-size: 1.6rem; line-height: 1.25; }
h2 { font-size: 1.15rem; margin-top: 2rem; }
a { color: var(--accent); }

.hero { text-align: center; padding-top: 24px; }
.hero h1 { font-size: 2.1rem; }
.sub { max-width: 620px; margin: 0 auto 1.5rem; color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-top: 2rem; text-align: left; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 16px; }
.card h3 { margin-top: 0; font-size: 1rem; }
.finePrint { color: var(--muted); font-size: .85rem; margin-top: 2rem; }

.btn {
  display: inline-block; background: var(--accent); color: #fff; border: 0;
  padding: 10px 20px; border-radius: 8px; font-size: 1rem; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--accent-dark); }
.btn.secondary { background: var(--card); color: var(--accent); border: 1px solid var(--accent); }
.btn.danger { background: var(--danger); }
.btn.xl { font-size: 1.2rem; padding: 16px 28px; width: 100%; }
.linklike { background: none; border: 0; color: var(--accent); cursor: pointer; font-size: .9rem; padding: 0; text-decoration: underline; }
.linklike.danger { color: var(--danger); }
form.inline { display: inline; }

.stack { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.stack label { display: flex; flex-direction: column; gap: 4px; font-size: .95rem; }
.stack input:not([type=checkbox]), .stack select {
  padding: 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 1rem; background: var(--card);
}
/* PLZ hat immer 5 Ziffern – ein Feld über die volle Breite sähe falsch aus. */
.stack .plzfield input { max-width: 9em; }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-size: .85rem; color: var(--muted); }
label.check input { margin-top: 3px; flex: 0 0 auto; }
/* Ohne diesen Wrapper wird JEDES Stück gemischten Inhalts (Text, <strong>, <a>) ein
   eigenes Flex-Item – der Einwilligungstext zerfiel dadurch in wirre Spalten.
   Mit dem <span> ist rechts der Checkbox ein normaler, umbrechender Absatz. */
label.check > span { flex: 1 1 auto; min-width: 0; }
/* Ein Feld, das nur in Verbindung mit dem Hebel darüber wirkt (Prüfbefund B28:
   „Warteliste-Vorrecht" ohne eingeschaltete Restplatz-Anzeige). Die Einrückung sagt
   ohne ein Wort: Das gehört zu der Checkbox darüber. */
.settings .subfield { border-left: 3px solid var(--border); padding-left: 14px; margin-left: 4px; }
fieldset { border: 1px solid var(--border); border-radius: 8px; }
legend { font-size: .9rem; padding: 0 6px; }
table.windows th { font-weight: 500; font-size: .85rem; text-align: left; padding: 4px 8px; }
table.windows td { text-align: center; padding: 4px 8px; }

.error { background: #fdecea; color: var(--danger); padding: 10px 14px; border-radius: 8px; }
.notice { background: #e7f4ef; color: var(--accent-dark); padding: 10px 14px; border-radius: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
code { background: #eef2f0; padding: 2px 6px; border-radius: 4px; }

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin: 1rem 0; }
.stat { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.stat .num { font-size: 1.5rem; font-weight: 700; }
.stat.big .num { color: var(--accent); font-size: 1.9rem; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
/* Klickbare Kacheln (Warteliste/Slots): führen dorthin, wo die Zahl herkommt. */
a.stat { display: block; color: inherit; text-decoration: none; cursor: pointer; }
a.stat:hover { border-color: var(--accent); }
.live { color: var(--danger); font-size: .8rem; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .35; } }

.slotline { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; margin-bottom: 8px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.events { list-style: none; padding: 0; }
.events li { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; font-size: .92rem; }
.events li.ev-filled { border-left: 4px solid var(--accent); }
.events li.ev-unfilled { border-left: 4px solid var(--danger); }
.events .ts { color: var(--muted); font-size: .8rem; margin-right: 8px; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 8px; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); font-size: .92rem; }
.badge { display: inline-block; background: #eef2f0; border-radius: 999px; padding: 2px 10px; font-size: .8rem; }
.badge.open { background: #fff3cd; color: #7a5b00; }
.badge.filled { background: #e7f4ef; color: var(--accent-dark); }
.badge.unfilled { background: #fdecea; color: var(--danger); }
.badge.new { background: #e3edfd; color: #1a56a8; }
/* Churn-Ampel im Betreiber-Bereich (/admin) – gleiche Farbwelt wie die Slot-Badges. */
.badge.ampel-gruen { background: #e7f4ef; color: var(--accent-dark); }
.badge.ampel-gelb { background: #fff3cd; color: #7a5b00; }
.badge.ampel-rot { background: #fdecea; color: var(--danger); }
/* Nutzungs-Punkt der Betreiber-Übersicht: nur ein Punkt, der Grund steht als Text
   daneben (kein title-Tooltip – der ist auf dem Handy unsichtbar). */
.ampelpunkt { font-size: .85rem; }
.ampelpunkt.ampel-gruen { color: var(--accent); }
.ampelpunkt.ampel-gelb { color: #c79100; }
.ampelpunkt.ampel-rot { color: var(--danger); }
.ampelpunkt.ampel-neutral { color: #9aa5a0; }
.abotext.abo-rot { color: var(--danger); font-weight: 600; }
.abotext.abo-gelb { color: #7a5b00; }
.zeile-problem td { background: #fffafa; }
/* Acht Spalten quetschen sich auf schmalen Fenstern sonst zu je einem Wort pro Zeile.
   Lieber eine feste Mindestbreite und den vorhandenen Seitwärts-Schieber (.tablewrap)
   als eine Tabelle, die man nicht mehr lesen kann. */
.admintab { min-width: 820px; }
/* Der Betreiber-Bereich ist eine Arbeitsansicht mit acht Spalten – ihm steht mehr
   Breite zu als den Praxis-Seiten (die bewusst schmal und ruhig bleiben). */
body[data-admin] main { max-width: 1100px; }
.kopfzeile { font-size: 1rem; }
.archivbox { margin: 18px 0; }
.archivbox summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.gefahrzeile { margin-top: 28px; }
.schmal { max-width: 420px; }

.hint { display: block; font-size: .8rem; color: var(--muted); font-weight: 400; margin-top: 2px; }
.bell { margin-left: auto; text-decoration: none; font-size: 1.15rem; position: relative; }
.bellcount {
  position: absolute; top: -6px; right: -10px; background: var(--danger); color: #fff;
  border-radius: 999px; font-size: .68rem; min-width: 16px; height: 16px; line-height: 16px;
  text-align: center; padding: 0 4px; font-weight: 700;
}
.bellcount:empty { display: none; }
.dp { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-left: 3px; vertical-align: baseline; }
.dp-v { background: #f2c14c; }
.dp-m { background: var(--accent); }
.dp-n { background: #5b8def; }
.wchip { display: inline-block; background: #eef2f0; border-radius: 6px; padding: 1px 6px; margin: 1px 2px 1px 0; font-size: .8rem; white-space: nowrap; }
/* Notiz wie in einer Notizen-App: das Feld sieht aus wie Text in der Zelle und
   zeigt seinen Rahmen erst beim Überfahren/Tippen – gespeichert wird beim
   Verlassen (public/app.js). field-sizing wächst beim Tippen mit; rows=1 ist der
   Fallback für ältere Browser (das JS-Autogrow in app.js hält die Höhe exakt passend).
   resize:none + overflow:hidden – der Größenzieh-Anfasser und der Scrollbalken
   waren laut Gründer (07.08.2026) „nutzlos und störend". */
.notef textarea {
  width: 100%; min-width: 140px; padding: 4px 6px; border: 1px solid transparent;
  background: transparent; color: inherit;
  border-radius: 6px; font: inherit; font-size: .82rem; resize: none; overflow: hidden;
  field-sizing: content;
}
.notef textarea:hover { border-color: var(--border); }
.notef textarea:focus { border-color: var(--accent); background: #fff; outline: none; }
.notef button { margin-top: 4px; }
.notesaved { color: var(--accent); margin-left: 2px; }
.notecell { min-width: 170px; }
[hidden] { display: none !important; }
/* Aktionen-Spalte: „✎ ändern" und „löschen" nebeneinander, nichts wird abgeschnitten. */
td.actions { white-space: nowrap; }
td.actions a { margin-right: 10px; }
/* Nicht editierbare Anzeige (z. B. die verifizierte Handynummer im Eintrag-Ändern) */
.readonlyval { padding: 10px; border: 1px dashed var(--border); border-radius: 8px; background: #eef2f0; }

.banner {
  background: #e7f4ef; border: 2px solid var(--accent); border-radius: 12px;
  padding: 14px 18px; margin-bottom: 1rem; animation: bannerIn .4s ease;
}
.banner-head { font-weight: 700; color: var(--accent-dark); font-size: 1.1rem; margin-bottom: 6px; }
/* Jede Meldung wird einzeln abgehakt. Ab ca. 8 Einträgen scrollt die LISTE intern
   (max-height ≈ 14em) – so bleibt die Übersicht kurz, und trotzdem verschwindet
   keine Meldung ungesehen (früher: LIMIT 10 anzeigen, aber alle quittieren). */
.banner ul { margin: 0 0 10px; padding-left: 0; list-style: none; max-height: 14em; overflow-y: auto; }
/* Jede Zeile klar abgegrenzt (Trennlinie), Haken-Kästchen rechts AUF derselben
   Linie – so ist auch beim Griff mitten in die Liste sofort eindeutig,
   welcher Haken zu welcher Meldung gehört (Gründer-Befund 07.08.). */
.banner li { display: flex; align-items: center; gap: 10px; padding: 8px 8px;
  border-bottom: 1px solid rgba(0, 0, 0, .1); }
/* Zebra: jede zweite Zeile leicht aufgehellt – Auge folgt der Zeile bis zum Kästchen */
.banner li:nth-child(odd) { background: rgba(255, 255, 255, .55); border-radius: 6px; }
.banner li:last-child { border-bottom: none; }
.banner li > span { flex: 1 1 auto; min-width: 0; }
.banner li form.ack { flex: 0 0 auto; margin-left: auto; }
/* Der Haken als sichtbares Kästchen (wie eine Checkbox zum Anklicken) */
.ackbtn { display: inline-flex; align-items: center; justify-content: center;
  width: 1.7em; height: 1.7em; font-size: 1rem; line-height: 1;
  border: 2px solid var(--accent); border-radius: 6px; background: #fff;
  color: var(--accent-dark); text-decoration: none; cursor: pointer; padding: 0; }
.ackbtn:hover { background: var(--accent); color: #fff; }
@keyframes bannerIn { from { transform: translateY(-8px); opacity: 0; } }

.claimbox { background: var(--card); border: 2px solid var(--accent); border-radius: 12px; padding: 18px; margin: 1rem 0; }
.claimbox .when { font-size: 1.4rem; font-weight: 700; color: var(--accent-dark); }

.aufsteller { text-align: center; background: var(--card); border: 2px dashed var(--border); border-radius: 12px; padding: 40px 24px; }
.aufsteller h1 { font-size: 2.2rem; margin-bottom: .5rem; }
/* Schaufenster-Aufsteller: Der Praxisname steht ueber der Ueberschrift (Befund C8) –
   ohne ihn wirkt das Plakat von aussen wie fremde Werbung im Fenster. */
.aufsteller-praxis { font-size: 1.3rem; font-weight: 700; margin: 0 0 .4rem; letter-spacing: .01em; }
.big-a { font-size: 1.15rem; }
/* Die drei Zeilen des Aushangs: linksbuendig, damit man sie im Vorbeigehen liest
   (zentrierter Flattersatz kostet den Passanten eine halbe Sekunde pro Zeile). */
.aufsteller-schritte { display: inline-block; text-align: left; max-width: 34rem;
  margin: 1.1rem auto; padding-left: 1.3rem; font-size: 1.05rem; line-height: 1.55; }
.aufsteller-schritte li { margin: .35rem 0; }
.qr svg { width: 240px; height: 240px; }
@media print {
  header, nav, footer, .noprint { display: none !important; }
  .aufsteller { border: none; }
  main { max-width: none; }
}
details.card summary { cursor: pointer; font-weight: 600; }
details.card form { margin-top: 14px; }

/* Einstellungen: Die Erklärungen an den Betriebs-Hebeln sind hier der eigentliche
   Inhalt, kein Kleingedrucktes – dunkler und größer als normale Hinweise
   (Gründer 07.08.: „zu gräulich, schwer zu lesen"). Das QR-Formular und andere
   Seiten behalten die dezente Hinweis-Optik. */
form.settings label.check { font-size: .95rem; color: var(--text); }
form.settings .hint { font-size: .9rem; color: #3d4a46; }
/* Einstellungen dürfen breiter atmen als schmale Eingabe-Formulare (Login/QR):
   Die Seite besteht vor allem aus Erklärtext – bei 460px (und auch bei 680px)
   wirkte sie auf großen Monitoren „gestaut" und links zusammengeschoben
   (Gründer 07.08.). Jetzt füllt das Formular die ganze Inhaltsspalte. */
form.settings { max-width: none; }
/* Jede Einstellung eine eigene Karte – so verteilt sich die Seite sichtbar in
   Blöcke, statt als eine lange Textwand links zu kleben. Nur direkte
   label-Kinder: die Praxisdaten (details.card) sind schon eine Karte. */
form.settings > label {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 14px 16px;
}
/* Ein Minutenfeld muss nicht 860px breit sein. Nur die Karten-Ebene – die Felder
   in den Praxisdaten bleiben, wie sie sind. */
form.settings > label input[type=number] { max-width: 12em; }
/* Die winzigen Standard-Kreise waren auf dem Monitor kaum zu treffen. */
form.settings input[type=checkbox] { width: 1.2em; height: 1.2em; accent-color: var(--accent); }

/* Termin-Etiketten als Kärtchen: feste Liste (Gesundheitsbranchen, nur Anzeige)
   und selbst angelegte Etiketten (Freitext-Branchen, mit ×) sehen gleich aus. */
.tagfield { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.taglist { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; }
.taglist:empty { display: none; }
.tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: #e7f4ef; color: var(--accent-dark); border: 1px solid var(--accent);
  border-radius: 999px; padding: 3px 12px; font-size: .85rem; line-height: 1.5;
}
.tag .tagx {
  background: none; border: 0; padding: 0; margin: 0; cursor: pointer;
  color: var(--accent-dark); font-size: 1.05rem; line-height: 1; text-decoration: none;
}
.tag .tagx:hover { color: var(--danger); }
form.settings .tagfield .taginput { width: 24em; max-width: 100%; }
/* Ohne JavaScript steht im Wrapper das kommagetrennte Feld selbst. Als Flex-Kind
   schrumpfte es auf die Standard-Feldbreite (~190px) – für bis zu 200 Zeichen
   Text zu wenig. Es nimmt die ganze Zeile, wie vor dem Kärtchen-Umbau. */
form.settings .tagfield input[name="services"] { flex: 1 1 100%; }

/* Zellen, die nie umbrechen sollen (z. B. „0 / 300" in der Betreiber-Tabelle). */
.nowrap { white-space: nowrap; }
