/* Praxis-App – ruhig, klar, hell/dunkel */
:root {
  --f: #24609c;
  --f-dunkel: color-mix(in srgb, var(--f) 75%, #000);
  --f-hell: color-mix(in srgb, var(--f) 10%, var(--grund));
  --f-ton: color-mix(in srgb, var(--f) 20%, var(--karte));
  --grund: #f5f5f1;
  --karte: #ffffff;
  --text: #1b2826;
  --leise: #5b6865;
  --linie: #e0e5e2;
  --gut: #1e7a46; --gut-hg: #e6f4ea;
  --warn: #9a4a12; --warn-hg: #fdf0e3;
  --gefahr: #b42318;
  --radius: 14px;
  --nav-b: 232px;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root { --grund: #121615; --karte: #1b2120; --text: #e6ece9; --leise: #9aa8a4; --linie: #2b3533; --gut: #6fcf97; --gut-hg: #183324; --warn: #f2b37a; --warn-hg: #3a2716; --gefahr: #ff8a7a;
    --f-dunkel: color-mix(in srgb, var(--f) 55%, #fff); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: var(--grund); color: var(--text); }
a { color: var(--f-dunkel); }
h1 { font-size: 1.55rem; margin: 0; line-height: 1.2; letter-spacing: -0.01em; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
h3 { font-size: .98rem; margin: 18px 0 8px; }
p { margin: 0 0 10px; }
.leise { color: var(--leise); }
.klein { font-size: .86rem; }
.mitte { text-align: center; }
.lade { padding: 40vh 20px; text-align: center; color: var(--leise); }
code.umbruch { word-break: break-all; display: block; background: var(--grund); padding: 10px; border-radius: 8px; font-size: .85rem; }

/* Navigation: Seitenleiste am Computer, Leiste unten am Handy */
.nav { position: fixed; z-index: 20; background: var(--karte); border-right: 1px solid var(--linie); top: 0; bottom: 0; left: 0; width: var(--nav-b); padding: 18px 12px; display: flex; flex-direction: column; gap: 4px; }
.nav-marke { display: flex; align-items: center; gap: 10px; font-weight: 700; padding: 6px 10px 18px; }
.punkt { width: 14px; height: 14px; border-radius: 50%; background: var(--f); display: inline-block; flex: none; }
.punkt.gross { width: 22px; height: 22px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 550; }
.nav a:hover { background: var(--f-hell); }
.nav a.akt { background: var(--f-ton); color: var(--f-dunkel); }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.haupt { margin-left: var(--nav-b); min-height: 100vh; }
.leiste { display: none; }
#inhalt { max-width: 1100px; margin: 0 auto; padding: 24px 28px 60px; transition: opacity .15s; }
#inhalt.laedt { opacity: .55; }
@media (max-width: 899px) {
  .nav { top: auto; right: 0; width: auto; height: calc(62px + env(safe-area-inset-bottom)); padding: 4px 4px env(safe-area-inset-bottom); flex-direction: row; border-right: 0; border-top: 1px solid var(--linie); justify-content: space-around; }
  .nav-marke { display: none; }
  .nav a { flex-direction: column; gap: 2px; font-size: .7rem; padding: 6px 2px; flex: 1; justify-content: center; }
  .haupt { margin-left: 0; padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .leiste { display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 15; background: var(--f); color: #fff; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
  .leiste-titel { font-weight: 700; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .leiste .rund { color: #fff; border-color: rgba(255,255,255,.4); background: transparent; }
  #inhalt { padding: 16px 14px 40px; }
}
.demo-schild { font-size: .72rem; font-weight: 700; background: #fff3; padding: 2px 8px; border-radius: 99px; }
.testband { background: var(--warn-hg); color: var(--warn); text-align: center; font-size: .82rem; padding: 6px 12px; }

/* Bausteine */
.seitenkopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.kopf-knoepfe { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kopf-knoepfe select { width: auto; }
.karte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.karte-kopf { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.karte-kopf h2 { margin: 0; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.zwei > .karte { margin-bottom: 0; }
@media (max-width: 800px) { .zwei { grid-template-columns: 1fr; } }
.zahlen { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.zahl { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; }
.karte .zahl { background: var(--grund); }
.zahl b { font-size: 1.45rem; line-height: 1.2; }
.zahl span { color: var(--leise); font-size: .85rem; }
.zahl.warn b { color: var(--warn); }
.abschnitt-titel { margin: 24px 0 10px; color: var(--leise); }

.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 18px; border-radius: 10px; background: var(--f); color: #fff; border: 1px solid var(--f); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap; }
.knopf:hover { filter: brightness(1.07); }
.knopf .ic { width: 18px; height: 18px; }
.knopf.leer { background: transparent; color: var(--f-dunkel); border-color: var(--linie); }
.knopf.leer:hover { background: var(--f-hell); }
.knopf.klein { min-height: 36px; padding: 0 12px; font-size: .9rem; }
.knopf.voll { width: 100%; }
.knopf.gefahr { color: var(--gefahr); }
.knopf.gefahr:not(.leer) { background: var(--gefahr); border-color: var(--gefahr); color: #fff; }
.knopf.aktiv { background: var(--f); color: #fff; }
.knopf:disabled { opacity: .5; cursor: default; }
.rund { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--linie); background: var(--karte); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; flex: none; text-decoration: none; }
.mini { width: 36px; height: 36px; border: 0; background: transparent; color: var(--leise); border-radius: 8px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; font-size: 1.2rem; flex: none; }
.mini:hover { background: var(--f-hell); color: var(--text); }
.mini .ic { width: 18px; height: 18px; }
.aktionen { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 14px; }
.leiste-unten { display: flex; justify-content: flex-end; gap: 10px; margin: 6px 0 20px; flex-wrap: wrap; }

.chip { display: inline-block; font-size: .76rem; font-weight: 650; padding: 2px 9px; border-radius: 99px; background: var(--f-hell); color: var(--f-dunkel); white-space: nowrap; }
.chip.gut, .chip.s-erschienen { background: var(--gut-hg); color: var(--gut); }
.chip.warn, .chip.s-nicht_erschienen { background: var(--warn-hg); color: var(--warn); }
.chip.neu { background: var(--f); color: #fff; }
.chip.leise, .chip.s-abgesagt { background: var(--grund); color: var(--leise); }

/* Listen */
.liste { display: flex; flex-direction: column; }
.zeile { display: flex; align-items: center; gap: 12px; padding: 11px 6px; border: 0; border-bottom: 1px solid var(--linie); background: transparent; color: var(--text); text-decoration: none; font: inherit; text-align: left; width: 100%; cursor: pointer; border-radius: 0; }
.zeile:last-child { border-bottom: 0; }
.zeile:hover { background: var(--f-hell); }
.zeile.abgesagt .z-text b { text-decoration: line-through; color: var(--leise); }
.zeile.kurs .z-zeit { color: var(--f-dunkel); }
.zeile.gefahr { color: var(--gefahr); }
.zeile .ic { color: var(--leise); }
.z-zeit { min-width: 64px; font-weight: 650; font-variant-numeric: tabular-nums; display: flex; flex-direction: column; font-size: .95rem; }
.z-zeit small { color: var(--leise); font-weight: 400; }
.z-text { flex: 1; min-width: 0; display: flex; flex-direction: column; text-decoration: none; color: inherit; }
.z-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.z-text small { color: var(--leise); }
.z-rechts { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.leer { color: var(--leise); padding: 6px 0; margin: 0; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--f-ton); color: var(--f-dunkel); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; text-transform: uppercase; }
.avatar.gross { width: 54px; height: 54px; font-size: 1.1rem; }
.balken { position: relative; display: inline-block; width: 110px; height: 22px; background: var(--grund); border-radius: 99px; overflow: hidden; flex: none; }
.balken.breit { width: 100%; margin: 6px 0; }
.balken i { position: absolute; inset: 0 auto 0 0; background: var(--f-ton); }
.balken.warn i { background: var(--warn-hg); }
.balken em { position: relative; font-style: normal; font-size: .76rem; font-weight: 650; padding: 0 9px; line-height: 22px; white-space: nowrap; }
.suchleiste { margin-bottom: 12px; }

/* Kalender */
.wochenleiste { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.woche-titel { flex: 1; text-align: center; display: flex; flex-direction: column; }
.woche-titel span { color: var(--leise); font-size: .9rem; }
.woche { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; align-items: start; }
@media (max-width: 899px) { .woche { grid-template-columns: 1fr; } }
.tag { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 10px; scroll-margin-top: 70px; }
.tag.heute { border-color: var(--f); box-shadow: 0 0 0 2px var(--f-hell); }
.tag-kopf { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; column-gap: 8px; align-items: baseline; margin-bottom: 8px; }
.tag-kopf small { grid-column: 1 / 3; color: var(--leise); font-size: .76rem; }
.tag-kopf .mini { grid-row: 1 / 3; grid-column: 3; }
.eintrag { display: flex; flex-direction: column; width: 100%; text-align: left; font: inherit; border: 0; border-left: 4px solid var(--f); background: var(--f-hell); color: var(--text); border-radius: 8px; padding: 7px 9px; margin-bottom: 6px; cursor: pointer; text-decoration: none; }
.eintrag b { font-size: .9rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eintrag small { font-size: .76rem; color: var(--leise); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.e-zeit { font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--f-dunkel); }
.eintrag.s-erschienen { border-left-color: var(--gut); background: var(--gut-hg); }
.eintrag.s-erschienen .e-zeit { color: var(--gut); }
.eintrag.s-abgesagt { border-left-color: var(--linie); background: var(--grund); opacity: .7; }
.eintrag.s-abgesagt b { text-decoration: line-through; }
.eintrag.s-nicht_erschienen { border-left-color: var(--warn); background: var(--warn-hg); }
.eintrag.kurs { border-left-color: #6b4ea2; background: color-mix(in srgb, #6b4ea2 12%, var(--karte)); }
.eintrag.kurs .e-zeit { color: #6b4ea2; }
.eintrag.sperre { border-left-color: var(--leise); background: repeating-linear-gradient(135deg, var(--grund), var(--grund) 6px, var(--karte) 6px, var(--karte) 12px); }
.eintrag.neu { box-shadow: inset 0 0 0 2px var(--f); }

/* Patient */
.patkopf { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.pat-name { min-width: 0; }
.pat-name p { margin: 2px 0 0; }
.kontakt-kurz { color: var(--leise); font-size: .92rem; margin-bottom: 10px; }
.notiz { background: var(--warn-hg); color: var(--text); padding: 8px 12px; border-radius: 8px; margin-top: 8px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; margin-bottom: 12px; border-bottom: 1px solid var(--linie); }
.tabs a { padding: 9px 14px; text-decoration: none; color: var(--leise); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.akt { color: var(--f-dunkel); border-bottom-color: var(--f); }
.doku-zeile { border-bottom: 1px solid var(--linie); padding: 10px 0; }
.doku-kopf { display: flex; gap: 10px; align-items: center; }
.doku-kopf small { color: var(--leise); flex: 1; }
.doku-zeile p { margin: 4px 0 0; white-space: pre-wrap; }
.doku-eintrag { background: var(--grund); padding: 8px 10px; border-radius: 8px; white-space: pre-wrap; }
dl.daten { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 8px; }
dl.daten dt { color: var(--leise); }
dl.daten dd { margin: 0; }
.neben { margin-left: 10px; }
.status-knoepfe { display: flex; gap: 6px; flex-wrap: wrap; }

/* Kurse */
.kursraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kurskarte { background: var(--karte); border: 1px solid var(--linie); border-radius: var(--radius); padding: 16px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; }
.kurskarte:hover { border-color: var(--f); }
.kk-kopf { display: flex; justify-content: space-between; gap: 8px; }
.kurskarte small { color: var(--leise); }
.kk-fuss { display: flex; justify-content: space-between; align-items: center; font-weight: 650; }
.tabelle-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.anwesenheit { border-collapse: collapse; min-width: 100%; }
table.anwesenheit th, table.anwesenheit td { padding: 6px 6px; border-bottom: 1px solid var(--linie); text-align: center; }
table.anwesenheit thead th { font-size: .75rem; color: var(--leise); font-weight: 500; }
table.anwesenheit thead th b, table.anwesenheit thead th small { display: block; }
table.anwesenheit tbody th { text-align: left; font-weight: 600; white-space: nowrap; position: sticky; left: 0; background: var(--karte); }
table.anwesenheit tbody th small { display: block; font-weight: 400; color: var(--leise); font-size: .75rem; }
table.anwesenheit input { width: 22px; height: 22px; accent-color: var(--f); }
table.tab { border-collapse: collapse; width: 100%; font-size: .9rem; }
table.tab th, table.tab td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--linie); vertical-align: top; }
table.tab th { color: var(--leise); font-weight: 600; font-size: .8rem; }

/* Formulare */
.form { display: flex; flex-direction: column; gap: 12px; }
.reihe { display: grid; gap: 12px; }
.reihe.r2 { grid-template-columns: 1fr 1fr; }
.reihe.r3 { grid-template-columns: 1fr 1fr 1fr; }
.reihe.adr { grid-template-columns: 3fr 1fr; }
.reihe.ort { grid-template-columns: 1fr 2fr; }
@media (max-width: 560px) { .reihe.r3 { grid-template-columns: 1fr 1fr; } }
.feld { display: flex; flex-direction: column; gap: 4px; font-size: .88rem; font-weight: 600; min-width: 0; }
.feld small { font-weight: 400; color: var(--leise); }
input, select, textarea { font: inherit; font-size: 16px; padding: 10px 11px; border: 1px solid var(--linie); border-radius: 10px; background: var(--karte); color: var(--text); width: 100%; min-width: 0; }
input[type=color] { padding: 3px; height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--f); outline-offset: -1px; }
textarea { resize: vertical; }
label.haken { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; cursor: pointer; }
label.haken input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--f); }
label.haken span { display: flex; flex-direction: column; }
label.haken small { color: var(--leise); font-weight: 400; }
.zeile.haken { align-items: center; }
.vorschlaege { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -4px; }
.vorschlaege small { color: var(--leise); width: 100%; }
.zeit-chip { border: 1px solid var(--f); background: var(--karte); color: var(--f-dunkel); border-radius: 8px; padding: 5px 9px; font: inherit; font-size: .85rem; font-weight: 600; cursor: pointer; }
.zeit-chip:hover { background: var(--f); color: #fff; }
.pwahl-gewaehlt { display: flex; align-items: center; gap: 10px; }
.pwahl-gewaehlt:empty { display: none; }
.pwahl-treffer { display: flex; flex-direction: column; border-radius: 10px; overflow: hidden; }
.treffer { text-align: left; border: 0; border-bottom: 1px solid var(--linie); background: var(--grund); padding: 9px 11px; font: inherit; color: var(--text); cursor: pointer; display: flex; flex-direction: column; }
.treffer small { color: var(--leise); font-weight: 400; }
.treffer.neu { color: var(--f-dunkel); font-weight: 600; }
.hinweis { background: var(--warn-hg); padding: 8px 12px; border-radius: 8px; }
.faq-zeile { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px solid var(--linie); }
.faq-zeile textarea { grid-column: 1; }
.faq-zeile .mini { grid-row: 1; grid-column: 2; }
.az-zeile { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--linie); flex-wrap: wrap; }
.az-zeile b { width: 100px; }
.az-block { display: flex; align-items: center; gap: 4px; }
.az-block input { width: 110px; }

/* Dialog */
dialog.dlg { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); background: var(--karte); color: var(--text); box-shadow: 0 20px 60px rgba(0,0,0,.25); display: flex; flex-direction: column; }
dialog.dlg:not([open]) { display: none; }
dialog.dlg.breit { width: min(860px, calc(100vw - 24px)); }
dialog::backdrop { background: rgba(10, 20, 18, .45); }
.dlg-kopf { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--linie); }
.dlg-kopf h2 { margin: 0; }
.dlg-kopf .x { border: 0; background: transparent; font-size: 1.6rem; line-height: 1; color: var(--leise); cursor: pointer; width: 40px; height: 40px; }
.dlg-inhalt { padding: 16px 18px; overflow-y: auto; flex: 1; }
.dlg-fuss { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--linie); flex-wrap: wrap; }
.dlg-fuss .gefahr:first-child { margin-right: auto; }
@media (max-width: 600px) { dialog.dlg { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 16px 16px 0 0; } }
.menue { display: flex; flex-direction: column; }

/* Anmeldung */
.anmeldung { max-width: 420px; margin: 0 auto; padding: 12vh 16px 40px; }
.anm-marke { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }

/* Anleitung */
.inhaltsverz { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.inhaltsverz a { background: var(--karte); border: 1px solid var(--linie); padding: 5px 11px; border-radius: 99px; text-decoration: none; font-size: .88rem; }
.anl ul { padding-left: 20px; }
.anl code { background: var(--grund); padding: 1px 5px; border-radius: 4px; }
.karte[id] { scroll-margin-top: 70px; }

#toast { visibility: hidden; opacity: 0; position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: #1d2b29; color: #fff; padding: 11px 18px; border-radius: 12px; font-weight: 600; z-index: 1000; transition: transform .25s; max-width: calc(100vw - 32px); box-shadow: 0 8px 30px rgba(0,0,0,.25); }
#toast.zeigen { transform: translate(-50%, 0); visibility: visible; opacity: 1; }
#toast.fehler { background: #b42318; }
#toast.gut { background: #1e7a46; }
@media (max-width: 899px) { #toast { bottom: calc(80px + env(safe-area-inset-bottom)); } }
.fehlertext { color: var(--gefahr); }
