/* Putzplan — iPad-Terminal. Helles, freundliches Theme (Blau-Pastell-Welt),
   grosse Touch-Ziele, Zimmer-Status dominant als Kachel-Hintergrund. */
:root {
  --blue: #0F62FE;
  --blue-hover: #3259E8;
  --blue-tint: #EDF5FF;
  --bg: #F7F8FB;
  --card: #FFFFFF;
  --txt: #21272A;
  --sub: #697077;
  --line: #DDE1E6;
  --green: #1F9254;
  --green-tint: #C9F0AA;
  --red: #D92D20;
  --red-tint: #FEE4E2;
  --amber: #B54708;
  --amber-tint: #FEF0C7;
  --radius-card: 18px;
  --radius-tile: 16px;
  --shadow: 0 2px 8px rgba(0,0,0,.06);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Manrope', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 26px; border-bottom: 1px solid var(--line);
  background: var(--card);
}
.brand { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-badge {
  width: 46px; height: 46px; border-radius: 12px; flex: 0 0 auto;
  background: var(--blue); color: #fff; display: grid; place-items: center;
}
.brand-badge svg { width: 26px; height: 26px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-eyebrow { font-size: 13px; color: var(--sub); font-weight: 500; }
.brand-title { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.header-right { display: flex; align-items: center; gap: 20px; }
.header-time { text-align: right; }
.clock { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 13px; color: var(--sub); }
.back-link {
  display: inline-flex; align-items: center; gap: 6px; text-decoration: none;
  color: var(--txt); background: var(--card); border: 1px solid var(--line);
  padding: 12px 18px; border-radius: 9999px; font-size: 17px; font-weight: 600;
  min-height: 56px;
}
.back-link svg { width: 20px; height: 20px; }

/* Main */
.main { padding: 22px 26px 40px; max-width: 1100px; margin: 0 auto; }
.section-label { font-size: 15px; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin: 26px 4px 12px; }

/* Flash */
.flash { padding: 14px 18px; border-radius: 12px; font-size: 17px; font-weight: 600; margin-bottom: 18px; border: 1px solid transparent; }
.flash.ok { background: var(--green-tint); color: #14562F; border-color: rgba(31,146,84,.35); }
.flash.err { background: var(--red-tint); color: var(--red); border-color: rgba(217,45,32,.35); }

/* Zeit-Karte */
.zeit-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 22px 26px; box-shadow: var(--shadow);
}
.zeit-card.is-in { border-color: rgba(31,146,84,.5); background: linear-gradient(180deg, rgba(201,240,170,.28), var(--card)); }
.zeit-name { font-size: 22px; font-weight: 800; }
.zeit-status { font-size: 17px; color: var(--sub); margin-top: 4px; }
.zeit-status b { color: var(--txt); }
.zeit-ist { font-size: 15px; color: var(--sub); margin-top: 8px; }
.zeit-ist b { color: var(--txt); }
.zeit-btn {
  display: inline-flex; align-items: center; gap: 10px; border: none; cursor: pointer;
  font-size: 20px; font-weight: 700; color: #fff; padding: 18px 34px;
  border-radius: 9999px; min-height: 64px;
}
.zeit-btn svg { width: 26px; height: 26px; }
.zeit-btn.kommen { background: var(--green); }
.zeit-btn.gehen { background: var(--blue); }
.zeit-btn:active { transform: scale(.97); }

/* Haus-Kacheln */
.haus-summary { font-size: 17px; color: var(--sub); margin-bottom: 4px; }
.haus-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.haus-tile {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--txt);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 24px; min-height: 190px; box-shadow: var(--shadow);
}
.haus-tile:active { transform: scale(.98); }
.haus-icon { width: 56px; height: 56px; border-radius: 14px; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.haus-icon svg { width: 30px; height: 30px; }
.haus-name { font-size: 26px; font-weight: 800; margin-top: 4px; }
.haus-count { font-size: 16px; color: var(--sub); }

/* Putzfrau-Auswahl (Timo-Kachel-Muster) */
.putz-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.putz-tile {
  display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: var(--txt);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 24px; min-height: 170px; box-shadow: var(--shadow);
}
.putz-tile:active { transform: scale(.98); }
.putz-tile.anwesend { border-color: rgba(31,146,84,.5); background: linear-gradient(180deg, rgba(201,240,170,.3), var(--card)); }
.putz-icon { width: 56px; height: 56px; border-radius: 50%; background: var(--blue-tint); color: var(--blue); display: grid; place-items: center; }
.putz-tile.anwesend .putz-icon { background: var(--green-tint); color: var(--green); }
.putz-icon svg { width: 30px; height: 30px; }
.putz-name { font-size: 25px; font-weight: 800; margin-top: 4px; }
.putz-status { font-size: 16px; color: var(--sub); display: flex; align-items: center; gap: 8px; margin-top: auto; }
.anw-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: 0 0 auto; }

/* Kopf-Badge: aktuell gewaehlte Putzfrau */
.who-badge {
  display: inline-flex; align-items: center; gap: 8px; color: var(--txt);
  background: var(--blue-tint); border: 1px solid rgba(15,98,254,.2); border-radius: 9999px;
  padding: 10px 16px; font-size: 17px; font-weight: 700; min-height: 56px;
}
.who-badge svg { width: 20px; height: 20px; color: var(--blue); }

/* Zimmer-Kacheln — Status dominant als Kachel-Hintergrund + grosses Icon */
.zimmer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.zimmer-tile {
  display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--txt);
  border-radius: var(--radius-tile); padding: 20px 22px; min-height: 160px; box-shadow: var(--shadow);
  background: var(--red-tint); border: 1px solid rgba(217,45,32,.28);
}
.zimmer-tile:active { transform: scale(.98); }
.zimmer-tile.erledigt { background: var(--green-tint); border-color: rgba(31,146,84,.35); }
.zt-head { display: flex; align-items: flex-start; }
.zt-name { font-size: 23px; font-weight: 800; line-height: 1.15; overflow-wrap: break-word; hyphens: auto; }
.zt-icon { display: grid; place-items: center; margin: 4px auto; color: var(--red); }
.zt-icon svg { width: 60px; height: 60px; }
.zimmer-tile.erledigt .zt-icon { color: var(--green); }
.zt-meta { font-size: 15px; color: #5a4a48; display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: auto; text-align: center; }
.zimmer-tile.erledigt .zt-meta { color: #3d5a45; }
.zt-meta svg { width: 16px; height: 16px; }

/* ── Phase B: Grundriss-Ansicht mit Status-Pins ─────────────────── */
.plan-block { margin-bottom: 6px; }
.plan-stage {
  position: relative; line-height: 0; max-width: 900px; margin: 0 auto;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card);
  overflow: hidden; box-shadow: var(--shadow);
}
.plan-img { display: block; width: 100%; height: auto; }
.plan-pin {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px; text-decoration: none;
}
.plan-pin:active { transform: translate(-50%, -50%) scale(.94); }
.pin-dot {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  color: #fff; border: 4px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,.32);
}
.pin-dot svg { width: 28px; height: 28px; }
.plan-pin.erledigt .pin-dot { background: var(--green); }
.plan-pin.offen .pin-dot { background: var(--red); }
.plan-pin.abnahme .pin-dot { background: var(--amber); }
.pin-label {
  display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 800;
  color: var(--txt); background: rgba(255,255,255,.92); border: 1px solid var(--line);
  border-radius: 9999px; padding: 3px 10px; white-space: nowrap; line-height: 1.3;
}
.pin-schaden {
  display: inline-flex; align-items: center; gap: 2px; background: var(--red); color: #fff;
  font-size: 12px; font-weight: 800; padding: 1px 7px; border-radius: 9999px;
}
.pin-schaden svg { width: 12px; height: 12px; }

/* Zimmer-Detail: Ablauf + Bestaetigen */
.detail-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-card); padding: 24px 26px; box-shadow: var(--shadow); }
.detail-card.erledigt { border-color: rgba(31,146,84,.45); }
.zimmer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.zimmer-name { font-size: 26px; font-weight: 800; }
.zimmer-status { font-size: 13px; font-weight: 800; color: var(--red); text-transform: uppercase; letter-spacing: .04em; padding: 5px 12px; border-radius: 9999px; background: var(--red-tint); }
.detail-card.erledigt .zimmer-status { color: var(--green); background: var(--green-tint); }
.ablauf-titel { font-size: 14px; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin: 0 0 10px; }
.ablauf-list { margin: 0 0 22px; padding-left: 26px; color: var(--txt); font-size: 18px; line-height: 1.7; }
.ablauf-list li { padding-left: 4px; }
.soll-leer { color: var(--sub); font-size: 16px; font-style: italic; }

/* Bestaetigen-Buttons (Verschmutzungsgrad) */
.grad-label { font-size: 16px; color: var(--sub); margin-bottom: 10px; }
.grad-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grad-btn {
  border: none; cursor: pointer; font-size: 20px; font-weight: 800; color: #fff;
  padding: 20px; border-radius: 14px; min-height: 64px;
}
.grad-btn:active { transform: scale(.97); }
.grad-leicht { background: var(--green); }
.grad-mittel { background: var(--amber); }
.grad-stark { background: var(--red); }

/* Erledigt-Zustand */
.zimmer-done { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.done-info { display: flex; align-items: center; gap: 12px; font-size: 17px; color: var(--txt); }
.done-check { width: 44px; height: 44px; flex: 0 0 auto; border-radius: 50%; background: var(--green-tint); color: var(--green); display: grid; place-items: center; }
.done-check svg { width: 24px; height: 24px; }
.grad-text.grad-leicht { color: var(--green); }
.grad-text.grad-mittel { color: var(--amber); }
.grad-text.grad-stark { color: var(--red); }
.undo-btn {
  border: 1px solid var(--line); background: var(--card); color: var(--sub);
  font-size: 16px; font-weight: 600; padding: 14px 22px; border-radius: 9999px; cursor: pointer; min-height: 56px;
}
.undo-btn:active { transform: scale(.97); }

/* ── Phase C: Abnahme / Schaden ─────────────────────────────────── */
/* Dritter Kachel-Zustand: Abnahme noetig (amber) */
.zimmer-tile.abnahme { background: var(--amber-tint); border-color: rgba(181,71,8,.3); }
.zimmer-tile.abnahme .zt-icon { color: var(--amber); }
.zimmer-tile.abnahme .zt-meta { color: #7a4a12; }
.zt-schaden {
  display: inline-flex; align-items: center; gap: 3px; margin-left: auto;
  background: var(--red); color: #fff; font-size: 14px; font-weight: 800;
  padding: 3px 9px 3px 7px; border-radius: 9999px; flex: 0 0 auto;
}
.zt-schaden svg { width: 14px; height: 14px; }

/* Abnahme-Seite */
.abnahme-hinweis { font-size: 17px; color: var(--txt); line-height: 1.5; margin: 0 0 18px; }
.abnahme-hinweis b { font-weight: 800; }
.abnahme-form { display: flex; flex-direction: column; gap: 18px; }
.foto-feld {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  border: 2px dashed var(--blue); border-radius: var(--radius-card);
  background: var(--blue-tint); color: var(--blue); padding: 30px 20px; cursor: pointer;
  text-align: center;
}
.foto-feld:active { transform: scale(.99); }
.foto-icon { display: grid; place-items: center; }
.foto-icon svg { width: 46px; height: 46px; }
.foto-text { font-size: 18px; font-weight: 700; color: var(--txt); }
.foto-feld input[type=file] { font-size: 16px; color: var(--sub); max-width: 100%; }
.abnahme-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ab-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; cursor: pointer; font-size: 19px; font-weight: 800; color: #fff;
  padding: 20px; border-radius: 14px; min-height: 68px;
}
.ab-btn svg { width: 24px; height: 24px; }
.ab-btn:active { transform: scale(.97); }
.ab-btn.ok { background: var(--green); }
.ab-btn.schaden { background: var(--red); }

/* Abnahme-Zusammenfassung im Zimmer-Detail */
.abnahme-summary { border-radius: 14px; padding: 14px 16px; margin-bottom: 18px; border: 1px solid transparent; }
.abnahme-summary.ok { background: var(--green-tint); border-color: rgba(31,146,84,.3); }
.abnahme-summary.schaden { background: var(--red-tint); border-color: rgba(217,45,32,.3); }
.as-row { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; }
.as-icon { display: grid; place-items: center; flex: 0 0 auto; }
.as-icon svg { width: 22px; height: 22px; }
.abnahme-summary.ok .as-icon { color: var(--green); }
.abnahme-summary.schaden .as-icon { color: var(--red); }
.schaden-mini { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.schaden-mini li { font-size: 16px; color: var(--txt); }
.kat-badge {
  display: inline-block; background: var(--card); border: 1px solid var(--line);
  border-radius: 9999px; padding: 2px 10px; font-size: 13px; font-weight: 700; margin-right: 6px;
}
.schaden-add {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 14px;
  text-decoration: none; color: var(--red); background: var(--card);
  border: 1px solid rgba(217,45,32,.4); border-radius: 9999px;
  padding: 12px 18px; font-size: 16px; font-weight: 700; min-height: 52px;
}
.schaden-add svg { width: 18px; height: 18px; }

/* Schaden-Formular */
.schaden-form-view { display: flex; flex-direction: column; gap: 8px; }
.feld-label { font-size: 14px; color: var(--sub); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin: 14px 0 8px; }
.kat-row { display: flex; flex-wrap: wrap; gap: 10px; }
.kat-chip { position: relative; }
.kat-chip input { position: absolute; opacity: 0; pointer-events: none; }
.kat-chip span {
  display: inline-block; padding: 14px 18px; border-radius: 9999px; cursor: pointer;
  background: var(--card); border: 2px solid var(--line); font-size: 17px; font-weight: 700; color: var(--txt);
  min-height: 56px; line-height: 28px;
}
.kat-chip input:checked + span { background: var(--blue-tint); border-color: var(--blue); color: var(--blue); }
.schaden-text {
  width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  font: inherit; font-size: 18px; resize: vertical; color: var(--txt); background: var(--card);
}
.schaden-save {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  border: none; cursor: pointer; font-size: 20px; font-weight: 800; color: #fff;
  background: var(--red); padding: 20px; border-radius: 14px; min-height: 68px; margin-top: 20px;
}
.schaden-save svg { width: 24px; height: 24px; }
.schaden-save:active { transform: scale(.97); }
.zimmer-status.schaden { color: var(--red); background: var(--red-tint); }

@media (max-width: 560px) {
  .zeit-card { flex-direction: column; align-items: stretch; }
  .zeit-btn { justify-content: center; width: 100%; }
  .grad-row { grid-template-columns: 1fr; }
  .abnahme-btns { grid-template-columns: 1fr; }
}
