/* Zimmer-CRM Teichhaus: fürs iPad gebaut, große Tippflächen, Farben wie die Website (Creme, Dunkelgrün, Messing). */
:root { --creme: #f6f1e7; --papier: #fffdf8; --gruen: #2f4a3a; --messing: #b0813f; --text: #23302a; --grau: #6b7268;
  --linie: #e2dccf; --ok: #2f7a4a; --gelb: #b7861b; --rot: #b23b2e; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--creme); color: var(--text); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--gruen); }
.kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .8rem 1.2rem;
  padding-top: max(.8rem, env(safe-area-inset-top)); background: var(--gruen); color: #fff; }
.kopf a { color: #fff; }
main { max-width: 900px; margin: 0 auto; padding: 1rem 1rem calc(6rem + env(safe-area-inset-bottom)); }
h1 { font-size: 1.6rem; margin: .5rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
p { margin: .25rem 0; }
.karte { background: var(--papier); border: 1px solid var(--linie); border-radius: 12px; padding: 1rem 1.1rem; margin: 0 0 1rem; }
.schmal { max-width: 420px; margin: 2rem auto; }
.zeile { display: flex; justify-content: space-between; align-items: flex-start; gap: .8rem; }
.gross { font-size: 1.15rem; font-weight: 600; }
.klein { color: var(--grau); font-size: .95rem; }
.notiz { background: var(--creme); border-radius: 8px; padding: .6rem .8rem; margin-top: .6rem; white-space: normal; }
.leer { color: var(--grau); padding: 2rem 0; text-align: center; }
.marke { flex: none; border-radius: 999px; padding: .2rem .7rem; font-size: .85rem; font-weight: 600; color: #fff; }
.marke.gruen { background: var(--ok); } .marke.gelb { background: var(--gelb); } .marke.rot { background: var(--rot); }
label { display: block; margin: .6rem 0; font-weight: 600; font-size: .95rem; }
input, select, textarea { display: block; width: 100%; margin-top: .3rem; font: inherit; font-weight: 400; padding: .7rem .8rem;
  min-height: 48px; border: 1px solid #cfc7b6; border-radius: 10px; background: #fff; color: var(--text); }
textarea { min-height: 90px; }
.zwei { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.knopf { display: inline-block; min-height: 48px; padding: .7rem 1.3rem; margin-top: .6rem; font: inherit; font-weight: 600;
  border: 1px solid var(--gruen); border-radius: 10px; background: #fff; color: var(--gruen); cursor: pointer; }
.knopf.haupt { background: var(--gruen); color: #fff; }
.knopf.warnung { border-color: var(--rot); color: var(--rot); }
.knoepfe { display: flex; gap: .6rem; flex-wrap: wrap; }
details { margin-top: .8rem; }
summary { cursor: pointer; color: var(--grau); padding: .4rem 0; min-height: 44px; display: flex; align-items: center; }
.zimmerwahl { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: .6rem; margin: .8rem 0; }
.wahl { position: relative; margin: 0; font-weight: 400; }
.wahl input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.wahl span { display: block; min-height: 64px; padding: .7rem .8rem; border: 2px solid var(--linie); border-radius: 10px; background: #fff; font-weight: 600; }
.wahl small { display: block; font-weight: 400; color: var(--grau); }
.wahl input:checked + span { border-color: var(--gruen); background: #e6efe8; }
.wahl input:focus-visible + span { outline: 3px solid var(--messing); }
.wahl.belegt span { opacity: .45; text-decoration: line-through; }
.hinweis { border-radius: 10px; padding: .8rem 1rem; margin-bottom: 1rem; font-weight: 600; }
.hinweis.ok { background: #e3f1e7; color: var(--ok); }
.hinweis.fehler { background: #f8e3e0; color: var(--rot); }
.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: var(--papier); border-top: 1px solid var(--linie);
  padding-bottom: env(safe-area-inset-bottom); z-index: 5; }
.tabs a { flex: 1; text-align: center; padding: 1rem .4rem; min-height: 56px; text-decoration: none; color: var(--grau); font-weight: 600; }
.tabs a[aria-current] { color: var(--gruen); box-shadow: inset 0 3px 0 var(--messing); }
.tabs b { display: inline-block; min-width: 1.5em; padding: 0 .4em; border-radius: 999px; background: var(--rot); color: #fff; font-size: .8rem; }
@media (max-width: 560px) { .zwei { grid-template-columns: 1fr; } }
/* Phase 2: Belegungsplan, Verlauf */
.marke.grau { background: var(--grau); }
.plan-nav { display: flex; gap: .6rem; margin-bottom: .8rem; }
.plan-nav .knopf { margin-top: 0; text-decoration: none; }
.plan-rahmen { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--papier); border: 1px solid var(--linie); border-radius: 12px; }
.plan { border-collapse: collapse; width: 100%; min-width: 1040px; table-layout: fixed; font-size: .9rem; }
.plan th, .plan td { border: 1px solid var(--linie); padding: 0; height: 52px; text-align: center; }
.plan thead th:first-child { width: 170px; }
.plan thead th { font-weight: 600; color: var(--grau); padding: .3rem 0; font-size: .8rem; }
.plan thead th.we { background: #f1ece0; }
.plan thead th.heute { color: #fff; background: var(--messing); }
.plan tbody th, .plan tfoot th { text-align: left; padding: 0 .6rem; line-height: 1.2; position: sticky; left: 0; background: var(--papier); z-index: 1; font-size: .9rem; }
.plan td a { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 52px; text-decoration: none; padding: 0 .3rem; }
.plan td.frei a { color: #c9c1b0; font-size: 1.2rem; }
.plan td.belegt a { color: #fff; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; justify-content: flex-start; }
.plan td.bestaetigt { background: var(--gruen); }
.plan td.im_haus { background: var(--messing); }
.plan td.abgereist { background: #9aa39a; }
.plan tfoot td { color: var(--grau); font-size: .8rem; height: 36px; }
.verlauf { list-style: none; margin: 0; padding: 0; }
.verlauf li { padding: .45rem 0; border-top: 1px solid var(--linie); }
.verlauf li:first-child { border-top: 0; }
details.karte summary { color: var(--rot); font-weight: 600; }
/* Phase 3: Heute-Seite, Kacheln, Diagramme */
.kacheln { display: grid; grid-template-columns: repeat(4, 1fr); gap: .8rem; margin-bottom: 1rem; }
.kachel { display: flex; flex-direction: column; background: var(--papier); border: 1px solid var(--linie); border-radius: 12px; padding: .9rem 1rem; text-decoration: none; color: var(--text); }
.kachel span { color: var(--grau); font-size: .9rem; font-weight: 600; }
.kachel strong { font-size: 2rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kachel small { color: var(--grau); }
.zwei-spalten { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.ok { color: var(--ok); font-weight: 600; }
.diagramm { display: block; width: 100%; height: auto; }
.diagramm .gitter { stroke: var(--linie); stroke-width: 1; }
.diagramm .heute { stroke: var(--messing); stroke-width: 1; stroke-dasharray: 3 3; }
.diagramm .achse { fill: var(--grau); font-size: 12px; }
.diagramm .wert { fill: var(--text); font-size: 13px; font-weight: 600; }
.diagramm .balken { fill: var(--gruen); }
.diagramm .balken.voll { fill: var(--messing); }
.diagramm .treffer { fill: transparent; }
.diagramm g:hover .balken { opacity: .8; }
.diagramm .linie { fill: none; stroke: var(--gruen); stroke-width: 2; stroke-linejoin: round; }
.diagramm .punkt { fill: var(--gruen); stroke: var(--papier); stroke-width: 2; }
.legende { color: var(--grau); font-size: .9rem; display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.legende .farbe { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-left: .6rem; }
.legende .farbe:first-child { margin-left: 0; }
.farbe.normal { background: var(--gruen); } .farbe.voll { background: var(--messing); }
.tabelle table { border-collapse: collapse; margin: .6rem 1.5rem .6rem 0; display: inline-table; vertical-align: top; font-variant-numeric: tabular-nums; }
.tabelle th, .tabelle td { text-align: left; padding: .25rem .8rem .25rem 0; border-bottom: 1px solid var(--linie); }
details.tabelle summary { color: var(--grau); }
@media (max-width: 760px) { .kacheln { grid-template-columns: 1fr 1fr; } .zwei-spalten { grid-template-columns: 1fr; } }
/* Phase 5: Mail an den Gast */
.mailtext { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: .95rem; line-height: 1.5; }
.knopf.gewaehlt { background: #e6efe8; border-width: 2px; }
.knoepfe .knopf { text-decoration: none; }
/* Phase 6: Testwoche-Korrekturen (iPad-Prüfung) */
.hinweis { position: sticky; top: .5rem; z-index: 4; box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.klein, .wahl small, .plan, .plan tbody th, .plan tfoot th { font-size: 1rem; }
.plan thead th, .plan tfoot td { font-size: .9rem; }
.diagramm .achse { font-size: 15px; }
.kopf a, .klein a, .name-link { display: inline-block; padding: .7rem .4rem; margin: -.7rem -.4rem; }
details.klapp > summary { color: var(--gruen); font-size: 1.15rem; font-weight: 600; }
@media (max-width: 900px) { .plan { min-width: 860px; } .plan thead th:first-child { width: 130px; } }
/* Startseite: ganze Breite in Spalten statt langer Liste */
@font-face { font-family: "Amatic SC"; src: url(mail/amatic.woff2) format("woff2"); font-weight: 700; font-display: swap; }
h1 { font-family: "Amatic SC", system-ui, sans-serif; font-size: 2.6rem; font-weight: 700; line-height: 1; letter-spacing: .02em; color: var(--gruen); }
main:has(.heute-raster), main:has(.plan-rahmen) { max-width: 1440px; }
.heute-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; align-items: stretch;
  grid-template-areas: "lage spiegel spiegel" "an ab anfr" "tage30 tage30 monat"; }
.heute-raster > .karte { margin: 0; }
.lage { grid-area: lage; } .spiegel { grid-area: spiegel; } .an { grid-area: an; } .ab { grid-area: ab; } .anfr { grid-area: anfr; }
.tage30 { grid-area: tage30; } .monat { grid-area: monat; }
.lage { display: flex; flex-direction: column; align-items: center; gap: .6rem; text-align: center; align-self: stretch; }
.ring { width: 170px; height: 170px; }
.ring circle { fill: none; stroke-width: 16; }
.ring .voll { stroke: var(--gruen); } .ring .leer { stroke: var(--linie); }
.ring-zahl { font-size: 32px; font-weight: 700; fill: var(--text); } .ring-text { font-size: 13px; fill: var(--grau); }
.lage-zahlen p { margin: .2rem 0; } .lage-zahlen strong { font-size: 1.15rem; }
.mini { color: var(--grau); } .mini span { color: var(--text); font-weight: 700; font-size: 1.3rem; font-variant-numeric: tabular-nums; margin-right: .2rem; }
.spiegel-raster { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; margin-top: .6rem; }
.zimmer { display: flex; flex-direction: column; gap: .15rem; min-height: 112px; padding: .7rem .8rem; border-radius: 10px; text-decoration: none; color: var(--text);
  border: 2px solid var(--linie); background: #fff; border-left-width: 6px; }
.zimmer.z-im { border-color: var(--gruen); background: #eef4ef; }
.zimmer.z-an { border-color: var(--messing); background: #faf3e6; }
.zimmer.z-frei { border-style: dashed; color: var(--grau); }
.zimmer-name { font-size: .95rem; color: var(--grau); font-weight: 600; }
.zimmer strong { font-size: 1.1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zimmer.z-frei strong { font-weight: 600; }
.zimmer-info { font-size: .95rem; }
.zimmer-weg { font-size: .95rem; color: var(--rot); font-weight: 600; margin-top: auto; }
.zahl { display: inline-block; min-width: 1.8em; padding: 0 .45em; margin-left: .3rem; border-radius: 999px; background: var(--creme); color: var(--gruen); text-align: center; font-size: 1rem; }
.zahl.rot { background: var(--rot); color: #fff; }
.eintrag { display: flex; justify-content: space-between; align-items: center; gap: .8rem; padding: .55rem 0; border-top: 1px solid var(--linie); }
.eintrag:first-of-type { border-top: 0; }
.eintrag p { margin: 0; }
form.inline { margin: 0; flex: none; }
.klein-knopf { margin-top: 0; padding: .5rem 1rem; }
.spaet { color: var(--messing); }
@media (max-width: 1000px) {
  .heute-raster { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "lage monat" "spiegel spiegel" "an ab" "anfr anfr" "tage30 tage30"; }
}
@media (max-width: 640px) {
  .heute-raster { grid-template-columns: 1fr; grid-template-areas: "lage" "spiegel" "an" "ab" "anfr" "tage30" "monat"; }
  .spiegel-raster { grid-template-columns: 1fr 1fr; }
}
/* Dienstplan (monatsweise) */
main:has(.dienst-raster) { max-width: 1440px; }
.dienst-raster { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start;
  grid-template-areas: "kal tag" "kal std"; }
.dienst-raster > .karte { margin: 0; }
.kalender-karte { grid-area: kal; } .tag-karte { grid-area: tag; } .stunden-karte { grid-area: std; }
.kalender { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.kal-kopf { text-align: center; font-weight: 600; color: var(--grau); padding: .2rem 0; }
.kal-tag { display: flex; flex-direction: column; gap: 2px; min-height: 92px; padding: .35rem .4rem; border-radius: 8px;
  border: 1px solid var(--linie); background: #fff; color: var(--text); text-decoration: none; overflow: hidden; }
.kal-tag.we { background: #f1ece0; }
.kal-tag.fremd { background: transparent; border-color: transparent; }
.kal-tag.heute .kal-nr { background: var(--messing); color: #fff; }
.kal-tag.gewaehlt { border: 2px solid var(--gruen); box-shadow: 0 0 0 2px #e6efe8; }
.kal-nr { align-self: flex-start; min-width: 1.7em; padding: 0 .3em; border-radius: 999px; font-weight: 700; text-align: center; }
.kal-dienst { font-size: .85rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: #e6efe8; border-radius: 4px; padding: 1px 4px; }
.kal-dienst { color: var(--grau); } .kal-dienst b { font-weight: 700; color: var(--gruen); }
h2.abstand { margin-top: 1.2rem; }
.stunden { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
.stunden th, .stunden td { padding: .45rem 0; border-top: 1px solid var(--linie); text-align: left; }
.stunden td { text-align: right; }
.im-dienst { align-self: stretch; text-align: left; border-top: 1px solid var(--linie); padding-top: .6rem; margin-top: .4rem; }
.im-dienst p { margin: .2rem 0; }
@media (max-width: 1000px) { .dienst-raster { grid-template-columns: 1fr 1fr; grid-template-areas: "kal kal" "tag std"; } }
@media (max-width: 640px) { .dienst-raster { grid-template-columns: 1fr; grid-template-areas: "kal" "tag" "std"; }
  .kal-tag { min-height: 64px; } }
/* Logo im Kopf (weiße Fassung der Website) */
.kopf { padding-top: max(.5rem, env(safe-area-inset-top)); padding-bottom: .5rem; }
.kopf .marke-logo { display: flex; padding: 0; margin: 0; align-items: center; gap: .8rem; text-decoration: none; }
.marke-logo img { display: block; height: 64px; width: auto; }
.marke-logo span { font-family: "Amatic SC", system-ui, sans-serif; font-weight: 700; font-size: 1.9rem; line-height: 1; padding-left: .8rem; border-left: 1px solid rgba(255,255,255,.4); }
/* Rechnung und Reinigung */
.rechnung { padding: .6rem 0; border-top: 1px solid var(--linie); }
.rechnung:first-of-type { border-top: 0; }
.rechnung.frisch { background: #eef4ef; border-radius: 10px; padding: .8rem 1rem; border: 2px solid var(--gruen); }
.frage { font-size: 1.15rem; font-weight: 700; color: var(--gruen); margin: .6rem 0 0; }
.gross-knopf { min-height: 60px; padding: .9rem 1.6rem; font-size: 1.1rem; }
.knoepfe a.knopf { text-decoration: none; }
.hinweis-klein { background: #faf3e6; color: #7a5a1e; border-radius: 8px; padding: .5rem .8rem; font-size: .95rem; }
.positionen th { font-weight: 400; } .positionen td { white-space: nowrap; padding-left: 1rem; }
.drei { display: grid; grid-template-columns: 1fr 2fr 5rem; gap: 0 1rem; }
fieldset.zahlart { border: 0; padding: 0; margin: .6rem 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .6rem; }
fieldset.zahlart legend { font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
fieldset.zahlart .wahl span { min-height: 52px; display: flex; align-items: center; }
.zimmer { padding: 0; }
.zimmer-link { display: flex; flex-direction: column; gap: .15rem; padding: .7rem .8rem; flex: 1; text-decoration: none; color: inherit; }
.zimmer.z-putzen { box-shadow: inset 0 0 0 2px #c58a2b; }
.putzen { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: 0; padding: .4rem .6rem .6rem .8rem;
  border-top: 1px dashed #c58a2b; color: #7a5a1e; font-weight: 600; font-size: .95rem; }
.plan-putzen { display: block; font-size: .8rem; color: #7a5a1e; font-weight: 600; }
@media (max-width: 640px) { .drei, fieldset.zahlart { grid-template-columns: 1fr; } }
/* Im Teichhaus-Backend eingebettet: kein eigener Kopf, Hintergrund vom Backend, Reiter oben statt unten fest */
.eingebettet, .eingebettet body { background: transparent; }
.eingebettet .kopf { display: none; }
.eingebettet main { padding: 0 0 1rem; max-width: 1440px; margin: 0; }   /* Überschrift + Reiter immer so breit wie „Heute“, egal welche Ansicht */
.eingebettet main:not(:has(.heute-raster, .plan-rahmen, .dienst-raster)) > :not(h1, .tabs) { max-width: 900px; }
.eingebettet main > h1 { margin-top: 0; }
.eingebettet .tabs { position: static; margin: 0 0 1.2rem; border: 1px solid var(--linie); border-radius: 12px; overflow-x: auto; padding: 0; scrollbar-width: none; }
.eingebettet .tabs a { flex: 1 0 auto; min-height: 0; padding: .7rem .9rem; white-space: nowrap; }

/* Dienstplan: Export/Drucken + Drucklayout (A4 quer, nur Kalender und Stunden) */
.plan-nav { flex-wrap: wrap; } .plan-nav-rechts { display: flex; gap: .6rem; margin-left: auto; }
.plan-nav-rechts .knopf { margin-top: 0; text-decoration: none; }
.nur-druck { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  body { background: #fff; } * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .kopf, .tabs, .plan-nav, .hinweis, .tag-karte, .dienst-raster form { display: none !important; }
  main, main:has(.dienst-raster) { max-width: none; margin: 0; padding: 0; }
  h1 { margin: 0 0 4mm; }
  .dienst-raster { display: block; } .dienst-raster > .karte { box-shadow: none; border: 0; padding: 0; }
  .kal-tag { min-height: 0; break-inside: avoid; }
  .kal-tag.gewaehlt { border: 1px solid var(--linie); box-shadow: none; }
  .kal-dienst { white-space: normal; font-size: 8pt; }
  .nur-druck { display: inline; }
  .stunden-karte { margin-top: 6mm; break-inside: avoid; } .stunden { width: auto; min-width: 60mm; } .stunden th { padding-right: 8mm; }
}
/* Verwaltung: ein Block je Zimmer (an/aus, Bearbeiten) */
.schalter { padding: .5rem 0; border-top: 1px solid var(--linie); }
.schalter > .zeile { align-items: center; }
.schalter-name { display: flex; align-items: center; gap: .7rem; }
.schalter details { margin-top: .3rem; }
.schalter details form { margin-top: .6rem; }
.zimmer-foto-klein { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; flex: none; }
.zimmer-foto { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 8px; margin-bottom: .5rem; }
.foto-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; margin-top: .7rem; }
.foto-kachel { margin: 0; }
.foto-kachel img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.foto-kachel figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .4rem; margin-top: .3rem; }
.foto-kachel .klein-knopf { padding: .45rem .7rem; white-space: nowrap; }
.foto-upload.ziehen { outline: 2px dashed currentColor; outline-offset: 6px; border-radius: 8px; }
.foto-vorschau figure { position: relative; margin: 0; }
.foto-vorschau img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.foto-vorschau button { position: absolute; top: .3rem; right: .3rem; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.foto-kachel form { margin: 0; }
