/* PVS – Stylesheet. Hell und ruhig, goldener Akzent (passend zum SD-Logo),
   an die alte App angelehnt. Bewusst schlicht und gut lesbar. */

:root {
  --gold:        #b8924a;
  --gold-dunkel: #9c7a38;
  --text:        #2f2c28;
  --muted:       #8a8079;
  --hintergrund: #f5f3ef;
  --karte:       #ffffff;
  --linie:       #e6e1d8;
  --ok-bg:       #e7f3e8;  --ok-text:     #2e6b34;
  --fehler-bg:   #fdeceb;  --fehler-text: #b3261e;
  --radius:      14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--hintergrund);
  line-height: 1.5;
}

h1 { font-size: 1.5rem; font-weight: 600; margin: 0; }
h2 { font-size: 1.15rem; font-weight: 600; margin: 0 0 .4rem; }
a  { color: inherit; }

/* --- Probe-Hinweis: auffaelliger Balken ganz oben auf jeder Seite --- */
.probe-balken {
  background: #7a4a12;            /* dunkles Bernstein – deutlich, aber nicht schrill */
  color: #fff;
  text-align: center;
  font-weight: 600;
  font-size: .95rem;
  letter-spacing: .03em;
  padding: .45rem 1rem;
}

/* --- Mini-Vorschau neu gewaehlter Fotos im Formular --- */
.foto-vorschau { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.foto-vorschau img {
  width: 72px; height: 72px; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--linie);
}
.vorschau-ersatz {
  display: flex; align-items: center; justify-content: center;
  width: 72px; height: 72px; padding: .25rem; overflow: hidden;
  border-radius: 8px; border: 1px solid var(--linie);
  background: var(--hintergrund); color: var(--muted);
  font-size: .65rem; text-align: center; word-break: break-all;
}

/* --- Hilfe-Seite (kleines Handbuch) --- */
.karte.hilfe { margin-bottom: 1rem; }
.karte.hilfe p:last-child { margin-bottom: 0; }

/* Beim Ausdrucken der Hilfe (PDF-Ausgabe des Handbuchs): Menueleiste weg. */
@media print {
  .kopf { display: none; }
}

/* --- Kopfzeile --- */
.kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .75rem 1.25rem;
  background: var(--karte); border-bottom: 1px solid var(--linie);
  position: sticky; top: 0; z-index: 10;
}
.marke { display: flex; align-items: center; gap: .6rem; text-decoration: none; }
.marke-bild { height: 34px; width: auto; }
.marke-text { font-weight: 600; letter-spacing: .04em; color: var(--text); }
.nav { display: flex; gap: 1.25rem; }
.nav a { text-decoration: none; color: var(--muted); font-weight: 500; }
.nav a:hover { color: var(--gold-dunkel); }
/* Der Abmelden-Knopf soll aussehen wie die anderen Menuepunkte. */
.nav-formular { display: inline; margin: 0; }
.nav-knopf {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--muted); font-weight: 500;
}
.nav-knopf:hover { color: var(--gold-dunkel); }

/* --- Inhaltsbereich --- */
.inhalt { max-width: 820px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

.seiten-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap;
}

.karte {
  background: var(--karte); border: 1px solid var(--linie);
  border-radius: var(--radius); padding: 1.5rem;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}

/* --- Knoepfe --- */
.knopf {
  display: inline-block; background: var(--gold); color: #fff;
  border: none; border-radius: 999px; padding: .6rem 1.3rem;
  font-size: 1rem; font-weight: 600; text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.knopf:hover { background: var(--gold-dunkel); }
.knopf-voll { width: 100%; padding: .8rem; margin-top: .5rem; }
.zurueck { color: var(--muted); text-decoration: none; font-weight: 500; }
.zurueck:hover { color: var(--gold-dunkel); }

/* --- Meldungen --- */
.meldung { border-radius: 10px; padding: .7rem 1rem; margin-bottom: 1rem; font-weight: 500; }
.meldung.ok     { background: var(--ok-bg);     color: var(--ok-text); }
.meldung.fehler { background: var(--fehler-bg); color: var(--fehler-text); }

/* --- Anmeldung --- */
.anmelde-karte { max-width: 360px; margin: 8vh auto 0; text-align: center; }
.anmelde-logo { height: 64px; width: auto; margin-bottom: .5rem; }
.anmelde-karte h1 { font-size: 1.3rem; letter-spacing: .03em; }
.unterzeile { color: var(--muted); margin: .25rem 0 1.5rem; }

/* --- Formulare --- */
.formular { display: flex; flex-direction: column; gap: 1rem; text-align: left; }
.formular label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; color: var(--muted); flex: 1; }
.formular input, .formular select, .formular textarea {
  font: inherit; color: var(--text);
  border: 1px solid var(--linie); border-radius: 10px;
  padding: .6rem .7rem; background: #fff; width: 100%;
}
.formular input:focus, .formular select:focus, .formular textarea:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,146,74,.15);
}
.feld-reihe { display: flex; gap: 1rem; flex-wrap: wrap; }
.feld-reihe label { min-width: 140px; }
.feld-reihe label.schmal { flex: 0 1 130px; }
.feld-reihe label.breit  { flex: 1 1 100%; }
.formular-knoepfe { margin-top: .5rem; }

/* Foto-Feld im Formular */
.foto-feld { display: flex; align-items: center; gap: 1rem; }
.foto-knopf {
  display: inline-block; cursor: pointer; color: var(--gold-dunkel);
  border: 1px dashed var(--gold); border-radius: 999px; padding: .45rem 1rem;
  font-weight: 600; font-size: .9rem;
}
.foto-knoepfe { display: flex; gap: .6rem; flex-wrap: wrap; }
/* Der Kamera-Knopf ist nur auf Touch-Geraeten (Handy/Tablet) sichtbar –
   am PC/Mac mit Maus gibt es meist keine brauchbare Kamera, dort reicht
   die Dateiauswahl. (.foto-knoepfe davor noetig, damit die Regel staerker
   ist als die allgemeine Label-Regel ".formular label".) */
@media (pointer: fine) { .foto-knoepfe .nur-kamera { display: none; } }

/* --- Suche --- */
.suche {
  width: 100%; font: inherit; padding: .7rem 1rem; margin-bottom: 1.25rem;
  border: 1px solid var(--linie); border-radius: 999px; background: #fff;
}
.suche:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(184,146,74,.15); }

/* --- Patientenliste --- */
.patientenliste { list-style: none; margin: 0; padding: 0; }
.patientenliste li { border-bottom: 1px solid var(--linie); }
.patient-zeile {
  display: flex; align-items: center; gap: 1rem; padding: .75rem .5rem;
  text-decoration: none; color: var(--text);
}
.patient-zeile:hover { background: #faf8f4; border-radius: 10px; }
.patient-name { font-weight: 600; flex: 1; }
.patient-ort { color: var(--muted); font-size: .9rem; }
.leer { color: var(--muted); padding: 1.5rem .5rem; }

/* --- Avatar --- */
.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; overflow: hidden;
  background: #efe9dd; color: var(--gold-dunkel); font-weight: 700; flex: none;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-gross { width: 88px; height: 88px; font-size: 1.6rem; }

/* --- Karteikarte --- */
.karteikarte-kopf { display: flex; align-items: center; gap: 1.25rem; margin-bottom: 1.25rem; }
.karteikarte-name { font-size: 1.4rem; }
.muted { color: var(--muted); margin: .2rem 0 0; }
.datenliste { margin: 0; display: grid; gap: .9rem; }
.datenliste > div { display: grid; grid-template-columns: 130px 1fr; gap: 1rem; }
.datenliste dt { color: var(--muted); font-weight: 600; margin: 0; }
.datenliste dd { margin: 0; }
.notiz { white-space: pre-wrap; }
.abschnitt-platzhalter { margin-top: 1.25rem; }

/* --- Behandlungen (Karteikarte) --- */
.behandlungen-kopf {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin: 2rem 0 1rem;
}
.behandlung { margin-bottom: 1rem; }
.behandlung-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.behandlung-titel { font-size: 1.1rem; font-weight: 600; margin: 0; }
.behandlung-datum { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.behandlung-beschreibung { white-space: pre-wrap; margin: .6rem 0 0; }
.behandlung-fotos { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .8rem; }
.behandlung-foto {
  display: block; width: 96px; height: 96px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--linie);
}
.behandlung-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.behandlung-fuss {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-top: 1rem; padding-top: .8rem;
  border-top: 1px solid var(--linie);
}
.behandlung-preis { font-weight: 700; color: var(--gold-dunkel); font-size: 1.05rem; }
.behandlung-goae { color: var(--muted); font-size: .85rem; margin-left: .8rem; }
.behandlung-aktionen { display: flex; gap: 1.1rem; }
.loeschen-link:hover { color: var(--fehler-text); }

/* Gefahr-Knopf (Loeschen bestaetigen) */
.knopf-gefahr { background: var(--fehler-text); }
.knopf-gefahr:hover { background: #8f1d16; }

/* --- Behandlungs-Formular: Bloecke und Foto-Galerie --- */
.feld-block { display: flex; flex-direction: column; gap: .5rem; }
.feld-titel { font-weight: 600; font-size: .9rem; color: var(--muted); }
.optional { font-weight: 400; color: var(--muted); }
.foto-auswahl { font-size: .85rem; }
.foto-galerie { display: flex; flex-wrap: wrap; gap: .7rem; }
.galerie-bild {
  display: flex; flex-direction: column; gap: .3rem; align-items: center;
  font-weight: 500; font-size: .8rem; color: var(--muted);
}
.galerie-bild img {
  width: 96px; height: 96px; object-fit: cover; border-radius: 10px;
  border: 1px solid var(--linie);
}
.galerie-entfernen { display: inline-flex; align-items: center; gap: .3rem; cursor: pointer; }
.galerie-entfernen input { width: auto; }

/* --- Rechnungen --- */
.behandlung-kopf-links { display: flex; align-items: center; gap: .6rem; }
.behandlung-haken { width: 18px; height: 18px; accent-color: var(--gold); cursor: pointer; flex: none; }
.rechnung-leiste {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-top: 1rem;
}
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th, .tabelle td { text-align: left; padding: .6rem .4rem; border-bottom: 1px solid var(--linie); }
.tabelle th { color: var(--muted); font-size: .85rem; font-weight: 600; }
.tabelle td.betrag, .tabelle th.betrag { text-align: right; white-space: nowrap; }
.posten { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.posten td { padding: .55rem .4rem; border-bottom: 1px solid var(--linie); }
.posten td.betrag { text-align: right; font-weight: 600; white-space: nowrap; }
.posten tr.summe-zeile td { border-top: 2px solid var(--linie); border-bottom: none; font-weight: 700; padding-top: .8rem; }
.empfaenger { margin: 1rem 0; line-height: 1.6; }
.rechnung-titel { margin-bottom: .6rem; }
.rechnung-drucken { margin-top: 1.8rem; padding-top: 1.2rem; border-top: 1px solid var(--linie); }
.rechnung-drucken .muted { margin-top: .6rem; }

/* --- Schmal (Handy) --- */
@media (max-width: 560px) {
  .datenliste > div { grid-template-columns: 1fr; gap: .2rem; }
  .kopf { flex-wrap: wrap; }
  .marke-text { display: none; }
  .behandlung-foto, .galerie-bild img { width: 80px; height: 80px; }
}
