:root {
  /* hairfree Markenfarben (Pantone-Logo: Rosé + Anthrazit) */
  --hf-magenta: #ef8ba3;        /* Logo-Rosé */
  --hf-magenta-dark: #e0728d;
  --hf-accent: #d6006e;         /* kräftiges Magenta für CTAs/Fokus */
  --hf-accent-dark: #b00059;
  --hf-ink: #3f3a44;            /* Logo-Anthrazit */
  --hf-muted: #8a8391;
  --hf-line: #eee9f0;
  --hf-bg: #faf8fb;
  --hf-card: #ffffff;
  --hf-ok: #1a9d5a;
  --hf-warn: #b8860b;
  --radius: 22px;
  --shadow: 0 14px 50px rgba(60, 20, 55, 0.07);
  --shadow-sm: 0 4px 18px rgba(60, 20, 55, 0.05);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--hf-bg);
  color: var(--hf-ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 18px 28px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 6px 12px;
}
.brand-logo { height: 40px; width: auto; display: block; }

.progress { padding: 6px 4px 14px; }
.progress-track { height: 6px; background: var(--hf-line); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 25%; background: var(--hf-accent); border-radius: 99px; transition: width .35s ease; }
.progress-label { font-size: 12.5px; color: var(--hf-muted); margin-top: 8px; font-weight: 600; }

.card {
  background: var(--hf-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 24px 28px;
  flex: 1;
  position: relative;
}

h1 { font-size: 25px; font-weight: 800; letter-spacing: -0.5px; margin: 0 0 6px; line-height: 1.2; }
.greeting { font-size: 29px; margin-bottom: 2px; }
.greeting span { -webkit-text-fill-color: initial; }
.greet-sub { font-size: 18px; font-weight: 700; color: var(--hf-ink); margin: 0 0 10px; }
.lead { color: var(--hf-muted); margin: 0 0 22px; font-size: 15.5px; }
.hint { color: var(--hf-muted); font-size: 13px; margin: 14px 2px 0; text-align: center; }

.field { display: block; margin-bottom: 18px; }
.field > span { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 7px; color: var(--hf-ink); }
select, input {
  width: 100%; padding: 15px 14px; font-size: 16px;
  border: 1.5px solid var(--hf-line); border-radius: 14px;
  background: #fff; color: var(--hf-ink); outline: none;
  transition: border-color .15s;
}
select:focus, input:focus { border-color: var(--hf-accent); box-shadow: 0 0 0 3px rgba(214, 0, 110, 0.10); }
.code-input { text-align: center; letter-spacing: 10px; font-size: 26px; font-weight: 700; }

.btn {
  width: 100%; border: none; border-radius: 16px; padding: 18px;
  font-size: 17px; font-weight: 800; cursor: pointer; margin-top: 10px;
  letter-spacing: -0.2px;
  transition: transform .06s, background .15s, opacity .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--hf-accent); color: #fff; box-shadow: 0 8px 22px rgba(214, 0, 110, 0.22); }
.btn.primary:hover { background: var(--hf-accent-dark); }
.btn.ghost { background: transparent; color: var(--hf-muted); font-weight: 600; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.linkbtn { background: none; border: none; color: var(--hf-muted); font-size: 14px; cursor: pointer; }

/* Behandlungsplan je Areal */
.plan-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 10px; }
.plan-areal { border: 1.5px solid var(--hf-line); border-radius: 18px; padding: 18px 18px 16px;
  background: #fff; box-shadow: var(--shadow-sm); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan-name { font-weight: 800; font-size: 16.5px; letter-spacing: -0.2px; }
.plan-status { font-size: 12.5px; font-weight: 800; padding: 5px 11px; border-radius: 99px; white-space: nowrap; }
.plan-status.done { background: #eaf6ef; color: var(--hf-ok); }
.plan-status.open { background: #fdf1e7; color: #b8860b; }
.plan-track { height: 12px; background: var(--hf-line); border-radius: 99px; overflow: hidden; margin: 14px 0 10px; }
.plan-fill { height: 100%; background: linear-gradient(90deg, var(--hf-magenta), var(--hf-accent)); border-radius: 99px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.plan-counts { font-size: 14px; color: var(--hf-muted); }
.plan-counts b { color: var(--hf-ink); font-weight: 800; }
.plan-next { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hf-line);
  display: flex; align-items: flex-start; gap: 11px; }
.plan-next .pn-ico { font-size: 17px; line-height: 1.4; }
.plan-next .pn-label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .5px; color: var(--hf-muted); }
.plan-next .pn-when { font-weight: 800; font-size: 15px; margin-top: 2px; }
.plan-next .pn-where { color: var(--hf-muted); font-size: 13.5px; }
.plan-next.none { color: var(--hf-muted); font-size: 13.5px; font-weight: 600; }

/* Portal-Module (Zukunftsarchitektur) */
#modulesSection { margin-top: 30px; padding-top: 22px; border-top: 1.5px solid var(--hf-line); }
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 6px; }
.module-tile {
  border: 1.5px solid var(--hf-line); border-radius: 16px; padding: 15px 14px;
  background: #fff; display: flex; flex-direction: column; gap: 7px; min-height: 92px;
  position: relative; transition: border-color .15s, transform .06s;
}
.module-tile .m-ico { font-size: 22px; }
.module-tile .m-title { font-weight: 800; font-size: 13.5px; line-height: 1.25; letter-spacing: -0.2px; }
.module-tile.active { border-color: var(--hf-accent); background: #fff6fb; }
.module-tile.active .m-title { color: var(--hf-accent-dark); }
.module-tile.soon { opacity: .82; }
.module-tile .m-badge { position: absolute; top: 10px; right: 10px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .4px; padding: 3px 8px; border-radius: 99px; }
.module-tile.active .m-badge { background: var(--hf-accent); color: #fff; }
.module-tile.soon .m-badge { background: var(--hf-line); color: var(--hf-muted); }
.module-tile.clickable { cursor: pointer; }
.module-tile.clickable:hover { border-color: var(--hf-accent); }
.module-tile.clickable:active { transform: translateY(1px); }

/* Modul: Zahlungen & Vertrag */
.pay-card { border: 1.5px solid var(--hf-line); border-radius: 18px; padding: 18px;
  background: #fff; box-shadow: var(--shadow-sm); margin-bottom: 16px; }
.pay-card.total { border-color: #e7dcec; background: linear-gradient(180deg,#fff,#fdfaff); }
.pay-banner { display: flex; align-items: center; gap: 12px; padding: 13px 15px;
  border-radius: 14px; margin-bottom: 14px; }
.pay-banner-ico { font-size: 20px; }
.pay-banner-label { font-weight: 800; font-size: 15px; }
.pay-banner-amt { font-size: 20px; font-weight: 800; margin-top: 2px; }
.pay-banner.pay-ok   { background: #eaf6ef; color: var(--hf-ok); }
.pay-banner.pay-warn { background: #fdf1e7; color: #b8860b; }
.pay-banner.pay-bad  { background: #fdecef; color: #b0003a; }
.pay-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; font-size: 15px;
  border-bottom: 1px solid var(--hf-line); }
.pay-row:last-child { border-bottom: none; }
.pay-row span { color: var(--hf-muted); }
.pay-row b { font-weight: 800; }
.pay-row.ok b { color: var(--hf-ok); }
.pay-row.open b { color: #b8860b; }
.pay-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.pay-card-title { font-weight: 800; font-size: 16.5px; }
.pay-pill { font-size: 15px; }
.pay-card-meta { color: var(--hf-muted); font-size: 13.5px; margin-bottom: 12px; }
.pay-inst { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--hf-line); }
.pay-inst-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.pay-inst-head b { font-size: 15.5px; }
.pay-inst-head span { color: var(--hf-muted); font-size: 13px; font-weight: 600; }
.pay-sub { font-weight: 800; font-size: 14px; margin: 16px 0 8px; color: var(--hf-ink); }
.pay-hist { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0;
  border-bottom: 1px solid var(--hf-line); }
.pay-hist:last-child { border-bottom: none; }
.ph-date { font-weight: 700; font-size: 14.5px; }
.ph-text { color: var(--hf-muted); font-size: 13px; }
.ph-right { text-align: right; }
.ph-amt { font-weight: 800; font-size: 14.5px; }
.ph-status { font-size: 12.5px; font-weight: 700; margin-top: 1px; }
.pay-hist.success .ph-status { color: var(--hf-ok); }
.pay-hist.failed .ph-status  { color: #b0003a; }
.pay-hist.pending .ph-status { color: var(--hf-muted); }
.pay-future { margin-top: 8px; }
.fut-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fut-tile { border: 1.5px dashed var(--hf-line); border-radius: 14px; padding: 13px 12px;
  display: flex; flex-direction: column; gap: 5px; opacity: .8; position: relative; min-height: 78px; }
.fut-ico { font-size: 19px; }
.fut-title { font-weight: 700; font-size: 13px; line-height: 1.25; }
.fut-badge { position: absolute; top: 9px; right: 9px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .4px; color: var(--hf-muted);
  background: var(--hf-line); padding: 2px 7px; border-radius: 99px; }

/* Vorher/Nachher-Vergleich auf der Bestätigungsseite */
.cmp-card { border: 1.5px solid var(--hf-line); border-radius: 16px; padding: 14px 16px; background: #fff; }
.cmp-card.new { border-color: var(--hf-magenta); background: #fffafd; }
.cmp-title { font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px;
  color: var(--hf-muted); margin-bottom: 8px; }
.cmp-card.new .cmp-title { color: var(--hf-magenta-dark); }
.cmp-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-size: 14.5px; }
.cmp-row span { color: var(--hf-muted); }
.cmp-row b { font-weight: 700; text-align: right; }
.cmp-arrow { text-align: center; font-size: 22px; color: var(--hf-magenta); font-weight: 800; margin: 4px 0; }
.bundle-note { margin-top: 12px; background: #faf0f6; color: var(--hf-magenta-dark);
  border-radius: 12px; padding: 11px 14px; font-size: 13.5px; font-weight: 700; }

/* Termin-Karten */
.appt-list { display: flex; flex-direction: column; gap: 14px; }
.appt {
  border: 1.5px solid var(--hf-line); border-radius: 16px; padding: 16px;
  position: relative; background: #fff;
}
.appt.bundle { border-left: 4px solid var(--hf-magenta); }
.appt .when { font-size: 17px; font-weight: 800; }
.appt .meta { color: var(--hf-muted); font-size: 14px; margin-top: 3px; }
.appt .tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.tag { background: #faf0f6; color: var(--hf-magenta-dark); font-size: 12.5px; font-weight: 700;
       padding: 4px 10px; border-radius: 99px; }
.tag.status { background: #eef6f1; color: var(--hf-ok); }
.appt .actions { margin-top: 12px; }
.appt .blocked-note {
  margin-top: 10px; font-size: 13px; color: var(--hf-warn);
  background: #fdf7e8; padding: 10px 12px; border-radius: 12px;
}
.btn.small { width: auto; padding: 10px 16px; font-size: 14.5px; margin: 0; }

/* Slots */
.slot-list { display: flex; flex-direction: column; gap: 12px; margin-bottom: 8px; }
.slot {
  border: 1.5px solid var(--hf-line); border-radius: 14px; padding: 15px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  cursor: pointer; background: #fff; transition: border-color .15s, background .15s;
}
.slot:hover { border-color: var(--hf-magenta); background: #fffafd; }
.slot .s-when { font-weight: 700; }
.slot .s-who { color: var(--hf-muted); font-size: 13px; }
.slot .chev { color: var(--hf-magenta); font-weight: 800; }

/* Offene Behandlungen */
.section-title { font-size: 18px; font-weight: 800; margin: 28px 0 4px; padding-top: 20px; border-top: 1.5px solid var(--hf-line); }
.section-lead { color: var(--hf-muted); font-size: 14px; margin: 0 0 16px; }
.open-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.open-item {
  display: flex; align-items: center; gap: 13px; padding: 15px 16px;
  border: 1.5px solid var(--hf-line); border-radius: 14px; cursor: pointer;
  background: #fff; transition: border-color .15s, background .15s; user-select: none;
}
.open-item.checked { border-color: var(--hf-magenta); background: #fffafd; }
.open-item input { width: 22px; height: 22px; accent-color: var(--hf-magenta); flex: 0 0 auto; }
.open-item .oi-main { flex: 1; }
.open-item .oi-areal { font-weight: 700; }
.open-item .oi-meta { color: var(--hf-muted); font-size: 13px; }
.open-item .oi-badge { font-size: 11.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.badge-open { background: #fdf2e8; color: #b8860b; }
.badge-missed { background: #fdecef; color: #b0003a; }
.badge-cancelled { background: #eef6f1; color: #1a9d5a; }

/* Absage */
.warn-box {
  background: #fdf2e8; color: #9a4a00; border: 1.5px solid #f3d9bf;
  padding: 14px 16px; border-radius: 14px; font-weight: 700; margin-bottom: 16px;
}
.btn.danger { background: #c0143c; color: #fff; }
.btn.danger:hover { background: #a01030; }
.check-row {
  display: flex; align-items: center; gap: 12px; margin: 16px 0 8px;
  padding: 14px 16px; border: 1.5px solid var(--hf-line); border-radius: 14px; cursor: pointer;
}
.check-row input { width: 22px; height: 22px; accent-color: var(--hf-magenta); }

.summary {
  background: #faf7fb; border: 1.5px solid var(--hf-line); border-radius: 16px;
  padding: 18px; white-space: pre-line; font-size: 15.5px; line-height: 1.7; margin-bottom: 6px;
}

.success-icon {
  width: 68px; height: 68px; border-radius: 50%; background: var(--hf-ok);
  color: #fff; font-size: 38px; display: flex; align-items: center; justify-content: center;
  margin: 8px auto 16px;
}

.error {
  margin-top: 16px; background: #fdecef; color: #b0003a; border: 1px solid #f6c9d3;
  padding: 13px 15px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
}

.spinner { display: flex; gap: 7px; justify-content: center; padding: 22px 0 6px; }
.spinner .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--hf-magenta); animation: b 1s infinite ease-in-out; }
.spinner .dot:nth-child(2) { animation-delay: .15s; }
.spinner .dot:nth-child(3) { animation-delay: .3s; }
@keyframes b { 0%,80%,100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }

.spinner-msg { text-align: center; color: var(--hf-muted); font-size: 14px; margin: 4px 0 0; padding: 0 12px; }

/* Während laufender Anfragen: Buttons gesperrt (kein Doppel-Klick) */
.busy .btn, .busy .slot, .busy .open-item, .busy .appt .actions button, .busy select, .busy input {
  pointer-events: none;
}
.busy .btn.primary, .busy .btn.danger { opacity: .6; }
.info-note { margin-top: 8px; font-size: 13px; color: var(--hf-muted);
  background: #f7f5f9; padding: 10px 12px; border-radius: 12px; }

.foot { text-align: center; color: var(--hf-muted); font-size: 12px; padding: 18px 0 4px; }
.hidden { display: none !important; }
