/* ===========================================================================
   NAMI – Design-Tokens & Grundlayout
   Markenfarbe: Wellness-Teal (波 = Welle/Fluss). Hell- und Dunkelmodus.
   Schrift: Quicksand (fein & rund) für die Wortmarke; Material Icons Round.
   Beide lokal gehostet (vendor/fonts) → funktioniert offline.
   =========================================================================== */
@font-face {
  font-family: 'Quicksand';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../vendor/fonts/quicksand-latin.woff2) format('woff2');
}
@font-face {
  font-family: 'Material Icons Round';
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url(../vendor/fonts/material-icons-round.woff2) format('woff2');
}
.mi {
  font-family: 'Material Icons Round';
  font-weight: normal; font-style: normal;
  font-size: 22px; line-height: 1; letter-spacing: normal; text-transform: none;
  display: inline-block; white-space: nowrap; word-wrap: normal; direction: ltr;
  -webkit-font-feature-settings: 'liga'; font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased; vertical-align: middle; user-select: none;
}

:root {
  --teal-900: #0b3f3e;
  --teal-800: #0b6e6c;
  --teal-700: #0e9594;  /* Primär */
  --teal-600: #14b8a6;
  --teal-500: #2dd4bf;
  --teal-100: #ccfbf1;
  --teal-50:  #f0fdfa;

  --green-500: #22c55e;
  --amber-500: #f59e0b;
  --red-500:   #ef4444;

  --gray-900: #0f172a;
  --gray-700: #334155;
  --gray-500: #64748b;
  --gray-400: #94a3b8;
  --gray-300: #cbd5e1;
  --gray-200: #e2e8f0;
  --gray-100: #f1f5f9;
  --gray-50:  #f8fafc;
  --white: #ffffff;

  --bg: var(--gray-100);
  --surface: #ffffff;
  --text: var(--gray-900);
  --muted: var(--gray-500);
  --border: var(--gray-200);
  --primary: var(--teal-700);
  --primary-strong: var(--teal-800);
  --primary-soft: var(--teal-50);
  --on-primary: #ffffff;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg: 0 12px 30px rgba(15,23,42,.14);
  --max-width: 720px;
}

body.dark {
  --bg: #0b1220;
  --surface: #131c2b;
  --text: #e6edf6;
  --muted: #93a4bd;
  --border: #243245;
  --primary: var(--teal-600);
  --primary-strong: var(--teal-500);
  --primary-soft: #10302f;
  --gray-100: #1a2434;
  --gray-50:  #131c2b;
  --shadow: 0 1px 3px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 30px rgba(0,0,0,.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
/* Das hidden-Attribut muss zuverlässig verbergen – sonst gewinnt z. B.
   .icon-btn{display:inline-flex} gegen die UA-Regel [hidden]{display:none}. */
[hidden] { display: none !important; }

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-text-size-adjust: 100%;
}
body {
  display: flex; flex-direction: column; min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

/* ---------- Header ---------- */
.app-header {
  background: var(--surface);
  padding: calc(env(safe-area-inset-top) + 12px) 16px 12px;
  display: flex; flex-direction: column; gap: 12px;
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand-left { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-logo { height: 32px; width: auto; display: block; }
.brand-name { font-family: 'Quicksand', sans-serif; font-weight: 500; font-size: 22px; letter-spacing: .22em; color: var(--primary); padding-left: .11em; }
.brand-plus { font-size: .55em; font-weight: 700; vertical-align: super; letter-spacing: 0; margin-left: -.16em; line-height: 0; }
.brand-actions { display: inline-flex; align-items: center; gap: 6px; }

.subtitle { color: var(--muted); font-size: 13px; }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

/* Rollen-/Modus-Umschalter */
.role-switch { display: inline-flex; background: var(--gray-100); border-radius: 999px; padding: 3px; gap: 2px; }
.role-btn {
  border: none; background: transparent; color: var(--muted);
  padding: 7px 14px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer;
}
.role-btn.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }

/* Icon-Buttons */
.icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; font-size: 18px;
}
.icon-btn:hover { background: var(--gray-100); }

/* ---------- Layout ---------- */
.view { flex: 1; width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 18px 16px 96px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card h2 { font-size: 17px; margin-bottom: 6px; }
.card p.muted { color: var(--muted); font-size: 14px; }

.empty-state { text-align: center; color: var(--muted); padding: 32px 16px; }
.empty-state .big-mark { font-size: 48px; opacity: .25; display:block; margin-bottom: 8px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  padding: 11px 16px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; cursor: pointer;
}
.btn:hover { background: var(--gray-100); }
.btn-primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-block { width: 100%; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ---------- Formulare ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.role-checks { display: flex; flex-direction: column; gap: 8px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 11px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-size: 15px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--teal-100);
}
.pw-wrap { position: relative; }
.pw-wrap .pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }

/* ---------- Login ---------- */
.auth-wrap { max-width: 380px; margin: 8vh auto 0; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 22px; }
.auth-logo img { height: 72px; }
.auth-logo .brand-name { font-size: 26px; }
.auth-sub { text-align: center; color: var(--muted); font-size: 14px; margin-bottom: 18px; }

/* ---------- Sprachumschalter ---------- */
.lang-switch { position: relative; }
.lang-current { display: inline-flex; align-items: center; gap: 6px; }
.lang-current img { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; }
.lang-menu {
  position: absolute; right: 0; top: 44px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; min-width: 150px;
}
.lang-menu button { display: flex; align-items: center; gap: 8px; width: 100%; border: none; background: transparent;
  color: var(--text); padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.lang-menu button:hover { background: var(--gray-100); }
.lang-menu img { width: 22px; height: 16px; border-radius: 2px; object-fit: cover; }

/* ---------- Bottom-Nav ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  background: var(--surface); border-top: 1px solid var(--border);
  display: flex; justify-content: space-around; padding: 6px 4px calc(env(safe-area-inset-bottom) + 6px);
}
.bottom-nav:empty { display: none; }
.nav-item {
  flex: 1; border: none; background: transparent; color: var(--muted); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; padding: 6px 2px;
}
.nav-item .ico { font-size: 22px; line-height: 1; }
.nav-item .mi { font-size: 24px; }
.nav-item.is-active { color: var(--primary); }
/* Icon-Größen-Varianten */
.mi-sm { font-size: 18px; }
.quick-card .mi { font-size: 30px; color: var(--primary); }
.done-mark .mi { font-size: 38px; }
.btn .mi { font-size: 20px; }
.icon-btn .mi { font-size: 22px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  background: var(--gray-900); color: #fff; padding: 12px 18px; border-radius: 999px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 60; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: var(--red-500); }
/* ---------- Undo-Snackbar ---------- */
.undo-bar {
  position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%) translateY(20px);
  display: flex; align-items: center; gap: 14px; background: var(--gray-900); color: #fff;
  padding: 8px 8px 8px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 61; max-width: 90vw;
}
.undo-bar.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.undo-btn { display: inline-flex; align-items: center; gap: 4px; border: none; cursor: pointer;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 13px; padding: 7px 14px; border-radius: 999px; }
.undo-btn:hover { filter: brightness(1.08); }
.undo-btn .mi { font-size: 18px; }

/* ---------- Update-/Install-Banner ---------- */
#update-banner:empty, #install-banner:empty { display: none; }
.app-bar {
  max-width: var(--max-width); margin: 0 auto; display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; font-size: 14px; font-weight: 600; color: #fff; background: var(--primary);
}
.app-bar .mi { font-size: 20px; flex: 0 0 auto; }
.app-bar span { flex: 1; min-width: 0; }
.app-bar button { background: #fff; color: var(--primary); border: none;
  padding: 6px 12px; border-radius: 8px; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.update-bar { background: var(--amber-500); }
.update-bar button { color: #b45309; }
.app-bar .install-close { background: transparent; color: #fff; padding: 4px; }
.app-bar .install-close .mi { font-size: 20px; }

/* Versionszeile (Login / Einstellungen) */
.login-version { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* DEMO-Kennzeichnung */
.demo-badge { display: none; padding: 2px 8px; border-radius: 999px; background: var(--amber-500);
  color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .08em; }
body.is-demo .demo-badge { display: inline-block; }

/* ---------- Breitere Ansicht (Kalender) ---------- */
.view.view-wide { max-width: 1120px; }

/* ---------- Abschnitts-Kopf / Seitentitel ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 4px 0 14px; }
.section-head h1, .page-title { font-size: 22px; font-weight: 800; }
.page-title { margin: 4px 0 14px; }

/* ---------- Listen ---------- */
.list-row { display: flex; align-items: stretch; gap: 0; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 10px; overflow: hidden; }
.row-color { flex: 0 0 6px; background: var(--gray-300); }
.row-main { flex: 1; min-width: 0; padding: 12px 14px; cursor: pointer; }
.row-title { font-weight: 700; font-size: 15px; }
.row-sub { color: var(--muted); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; align-items: center; gap: 6px; padding: 8px 10px; }
.btn-sm { padding: 6px 10px; font-size: 13px; }

/* Badges */
.badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 999px; background: var(--gray-100); color: var(--gray-700); }
.badge-on { background: var(--teal-50); color: var(--teal-800); }
body.dark .badge-on { background: #10302f; color: var(--teal-500); }
.badge-off { background: var(--gray-100); color: var(--gray-500); }

/* Statistik-Kacheln (Dashboard) */
.dash-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.dash-stat { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 18px 12px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); color: var(--text); position: relative; }
.dash-stat:hover { border-color: var(--primary); }
.dash-stat .dash-ico { position: absolute; top: 10px; right: 12px; color: var(--gray-300); }
.dash-stat .dash-ico .mi { font-size: 22px; }
.dash-num { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1.1; }
.dash-lbl { font-size: 13px; color: var(--muted); font-weight: 600; text-align: center; }
@media (max-width: 560px) { .dash-stats { grid-template-columns: repeat(3, 1fr); gap: 8px; } .dash-num { font-size: 24px; } .dash-stat { padding: 14px 6px; } .dash-stat .dash-ico { display: none; } }

/* Heutige Termine (Dashboard) */
.dash-today { margin-bottom: 16px; }
.dash-today-head { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--text); margin: 4px 2px 8px; }
.dash-today-head .mi { font-size: 20px; color: var(--muted); }
.dash-today-head .link-btn { margin-left: auto; background: none; border: 0; color: var(--primary); font-weight: 700; font-size: 13px; cursor: pointer; padding: 4px; }
.dash-appt { display: flex; align-items: center; gap: 8px; text-align: left;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px 12px; margin-bottom: 6px; color: var(--text); }
.dash-appt:hover { border-color: var(--primary); }
.dash-appt.is-now { border-color: var(--primary); box-shadow: inset 3px 0 0 var(--primary); }
.dash-appt-click { display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-width: 0; cursor: pointer; background: none; border: 0; color: inherit; text-align: left; padding: 0; }
.dash-appt-time { font-weight: 800; font-size: 15px; flex: 0 0 auto; min-width: 46px; }
.dash-appt-bar { flex: 0 0 auto; width: 4px; align-self: stretch; border-radius: 2px; }
.dash-appt-main { display: flex; flex-direction: column; gap: 1px; min-width: 0; flex: 1 1 auto; }
.dash-appt-title { font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-appt-sub { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-appt-live { flex: 0 0 auto; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  color: var(--primary); background: var(--primary-soft); border-radius: 999px; padding: 2px 8px; }
.dash-cust-btn { flex: 0 0 auto; }
.dash-intake { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700;
  border-radius: 999px; padding: 4px 10px; border: 1px solid transparent; white-space: nowrap; }
.dash-intake .mi { font-size: 16px; }
.dash-intake.is-ok { color: #1a7f4b; background: #e7f6ec; }
.dash-intake.is-flag { color: #a02019; background: #fdecea; }
.dash-intake.is-missing { color: #8a5a00; background: #fff6e5; border-color: #f3d28a; cursor: pointer; }
.dash-intake.is-missing:hover { background: #ffefcc; }

/* Quick-Grid (Dashboard) */
.quick-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.quick-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  cursor: pointer; font-weight: 700; color: var(--text); }
.quick-card:hover { border-color: var(--primary); }
.quick-card .ico { font-size: 28px; }

.err-text { color: var(--red-500); font-weight: 600; }
.field-hint { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* ---------- Formular-Raster / Checkboxen ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.field textarea { resize: vertical; font-family: inherit; }
input[type="color"] { height: 44px; padding: 4px; cursor: pointer; }
.check { display: flex; align-items: center; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 15px; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.check-list { display: flex; flex-direction: column; gap: 2px; max-height: 200px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px 10px; }
.check-list .check { padding: 6px 0; }

/* Zahlungsart-Auswahl (Online-Buchung) */
.field-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.pay-methods { display: flex; gap: 8px; }
.pay-method { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 12px 10px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card, #fff); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.pay-method .mi { font-size: 20px; }
.pay-method.is-on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.pay-area { min-height: 48px; }

/* Gutschein-Wizard */
.voucher-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.amount-btn { padding: 14px 8px; border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card, #fff); color: var(--text); font: inherit; font-weight: 700; font-size: 16px; cursor: pointer; }
.amount-btn.is-on { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.voucher-motifs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.motif { padding: 0; border: 2px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
  background: none; cursor: pointer; line-height: 0; }
.motif img { width: 100%; height: 96px; object-fit: cover; display: block; }
.motif.is-on { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }

/* Gutschein-Verwaltung */
.seg { display: flex; gap: 4px; }
.seg-btn { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: var(--card, #fff); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; }
.seg-btn.is-on { background: var(--primary); color: #fff; border-color: var(--primary); }
.voucher-row .vc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.vc-code { font-family: 'Consolas','Courier New',monospace; font-weight: 700; font-size: 16px; letter-spacing: 1px; }
.vc-amount { font-weight: 800; font-size: 18px; color: var(--primary); white-space: nowrap; }
.vc-reds { margin-top: 8px; border-top: 1px dashed var(--border); padding-top: 6px; }
.vc-red { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 2px; }
.vc-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Bonusprogramm */
.loyal-head { margin: 2px 0 6px; }
.loyal-bar { height: 10px; background: var(--gray-200); border-radius: 6px; overflow: hidden; }
.loyal-fill { height: 100%; background: var(--primary); border-radius: 6px; transition: width .3s; }
body.dark .loyal-bar { background: #243245; }

/* ---------- Modal ---------- */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 50;
  display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.modal-box { background: var(--surface); width: 100%; max-width: 560px; max-height: 92vh; display: flex; flex-direction: column;
  border-radius: var(--radius) var(--radius) 0 0; box-shadow: var(--shadow-lg); animation: nami-up .2s ease; }
@keyframes nami-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (min-width: 600px) { .modal-overlay { align-items: center; padding: 20px; } .modal-box { border-radius: var(--radius); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); }
.modal-head h2 { font-size: 18px; }
.modal-body { padding: 18px; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--border); }
.modal-foot .btn { min-width: 96px; }
.btn-danger { background: var(--red-500); color: #fff; border-color: var(--red-500); }
.btn-danger:hover { filter: brightness(.95); }
.new-cust { margin: -6px 0 14px; padding: 12px; background: var(--gray-50); border-radius: var(--radius-sm); }
.new-cust input { margin-bottom: 8px; }

/* ---------- Zeiten-Editor (mehrere Zeiträume je Tag) ---------- */
.hours-editor { display: flex; flex-direction: column; gap: 4px; }
.hours-day-block { padding: 8px 0; border-bottom: 1px solid var(--border); }
.hours-day-block:last-child { border-bottom: none; }
.hours-day-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hours-day { font-weight: 700; font-size: 14px; }
.range-empty { color: var(--muted); font-size: 13px; margin-top: 6px; }
.range-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.range-row { display: grid; grid-template-columns: 1fr auto 1fr auto; align-items: center; gap: 8px; }
.range-row input[type="time"] { padding: 8px; }
.hours-sep { text-align: center; color: var(--muted); }
.icon-btn-sm { width: 32px; height: 32px; }
.icon-btn-sm .mi { font-size: 18px; }

/* ---------- Kalender ---------- */
/* Toolbar: EINE Zeile – links Tabs · mittig (‹ Heute › + Datum) · rechts Zoom + Termin */
.cal-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px 12px; margin-bottom: 16px; }
.cal-grp { display: inline-flex; align-items: center; gap: 10px; }
.cal-grp-left { justify-self: start; }
.cal-grp-center { justify-self: center; }
.cal-grp-right { justify-self: end; }
.cal-datewrap { display: inline-flex; align-items: center; gap: 8px; }
.cal-range { font-weight: 800; font-size: 17px; letter-spacing: .01em; white-space: nowrap; }
.cal-today-badge { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  background: var(--primary); color: var(--on-primary); padding: 3px 8px; border-radius: 999px; }
@media (max-width: 920px) {
  .cal-toolbar { display: flex; flex-wrap: wrap; }
  .cal-grp-left { order: 1; }
  .cal-grp-right { order: 2; margin-left: auto; }
  .cal-grp-center { order: 3; width: 100%; justify-content: center; }
}
.cal-tabs { display: inline-flex; background: var(--gray-100); border-radius: 999px; padding: 3px; gap: 2px; height: 40px; align-items: center; }
.cal-tab { border: none; background: transparent; color: var(--muted); padding: 0 16px; height: 34px; border-radius: 999px; font-weight: 700; font-size: 14px; cursor: pointer; }
.cal-tab.is-active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
/* Pillen-Gruppen (Navigation, Zoom) */
.cal-pill { display: inline-flex; align-items: center; height: 40px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); overflow: hidden; }
.cal-pill .pill-btn { border: none; background: transparent; height: 100%; padding: 0 10px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text); font-weight: 700; font-size: 14px; }
.cal-pill .pill-btn:hover { background: var(--gray-100); }
.cal-pill .pill-btn + .pill-btn { border-left: 1px solid var(--border); }
.cal-pill .pill-btn .mi { font-size: 20px; }
.cal-pill .pill-today { padding: 0 14px; }
.cal-filter { height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; max-width: 200px; }
/* Ressourcen-Mehrfachauswahl */
.cal-filter-wrap { position: relative; }
.cal-filter-btn { height: 40px; padding: 0 10px 0 12px; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; max-width: 230px; }
.cal-filter-lbl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-filter-btn .mi { color: var(--muted); flex: 0 0 auto; }
.cal-filter-menu { position: absolute; right: 0; top: 46px; z-index: 40; min-width: 220px; max-height: 60vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-lg); padding: 6px; }
.cal-filter-head { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 8px 10px 4px; }
.cal-filter-opt { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.cal-filter-opt:hover { background: var(--gray-100); }
.cal-filter-opt.is-bold { font-weight: 700; }
.cal-filter-opt input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--primary); }
.cal-filter-name { flex: 1; cursor: pointer; }
.cal-filter-muted { color: var(--muted); cursor: default; }
/* Picker im Feld-Look (wie das Kundenfeld): volle Breite, eckiger Rahmen */
.cal-filter-wrap.is-fieldwide { display: block; }
.cal-filter-btn.is-input { width: 100%; max-width: none; height: auto; padding: 11px 12px; border-radius: var(--radius-sm);
  font-weight: 400; font-size: 15px; justify-content: space-between; }
.cal-filter-btn.is-input .cal-filter-lbl { flex: 1; text-align: left; }
.cal-filter-wrap.is-fieldwide .cal-filter-menu { left: 0; right: 0; min-width: 0; }
.cal-add { height: 40px; padding-top: 0; padding-bottom: 0; border-radius: 999px; }
.btn.is-active { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.cal-host { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cal-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.cal-grid { display: grid; grid-template-columns: 52px repeat(7, minmax(96px, 1fr)); }
.cal-resname { font-size: 13px; font-weight: 700; text-align: center; padding: 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.res-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: 6px; vertical-align: middle; }
/* Abwesenheit im Tag/Wochenraster (gestreift) */
.cal-abs { position: absolute; left: 2px; right: 2px; border-radius: 6px; overflow: hidden; z-index: 1;
  background: repeating-linear-gradient(45deg, rgba(100,116,139,.18), rgba(100,116,139,.18) 6px, rgba(100,116,139,.30) 6px, rgba(100,116,139,.30) 12px);
  color: var(--gray-700); font-size: 10px; font-weight: 700; }
.cal-abs span { display: block; padding: 3px 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-axis { border-right: 1px solid var(--border); }
.cal-corner { height: 44px; border-bottom: 1px solid var(--border); }
.cal-hour { font-size: 11px; color: var(--muted); text-align: right; padding: 2px 6px 0 0; box-sizing: border-box; border-bottom: 1px dashed transparent; }
.cal-col { border-right: 1px solid var(--border); }
.cal-col:last-child { border-right: none; }
.cal-col.is-today { background: var(--teal-50); }
body.dark .cal-col.is-today { background: #10302f55; }
.cal-colhead { height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.cal-wd { font-size: 11px; color: var(--muted); font-weight: 700; }
.cal-dd { font-size: 16px; font-weight: 800; }
.cal-colbody { position: relative; cursor: copy; }
.cal-line { position: absolute; left: 0; right: 0; border-top: 1px solid var(--border); }
.cal-open { position: absolute; left: 0; right: 0; background: var(--teal-50); }
body.dark .cal-open { background: #14b8a611; }
.cal-appt { position: absolute; left: 3px; right: 3px; background: var(--surface); border: 1px solid var(--border);
  border-left: 4px solid var(--primary); border-radius: 8px; padding: 3px 6px; overflow: hidden; cursor: pointer;
  box-shadow: var(--shadow); font-size: 11px; }
.cal-appt:hover { filter: brightness(.97); z-index: 3; }
.cal-appt-t { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt-s { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-appt.status-cancelled { opacity: .5; text-decoration: line-through; }
.cal-appt.status-pending { border-left-style: dashed; }
.cal-appt.status-completed { background: var(--teal-50); }
body.dark .cal-appt.status-completed { background: #10302f; }

/* ---------- Monatsansicht ---------- */
.cal-month { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.cal-mwd { background: var(--surface); text-align: center; font-size: 11px; font-weight: 700; color: var(--muted); padding: 6px 0; }
.cal-mcell { background: var(--surface); min-height: 92px; padding: 4px 5px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; }
.cal-mcell:hover { background: var(--gray-50); }
.cal-mcell.is-other { background: var(--gray-50); color: var(--muted); }
.cal-mcell.is-other .cal-mday { color: var(--gray-400); }
.cal-mday { font-size: 13px; font-weight: 700; align-self: flex-end; }
.cal-mcell.is-today .cal-mday { background: var(--primary); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; }
.cal-mbar { font-size: 10px; border-left: 3px solid var(--primary); background: var(--gray-100); border-radius: 4px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-mmore { font-size: 10px; color: var(--muted); font-weight: 700; }

/* ---------- Belegung (Hotel-Zeitstrahl) ---------- */
.tl-wrap { overflow: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); max-height: 72vh;
  scrollbar-width: none; -ms-overflow-style: none; }   /* Scrollbalken ausblenden (Schieben per Maus/Wheel) */
.tl-wrap::-webkit-scrollbar { width: 0; height: 0; display: none; }
.tl-grid { display: inline-block; min-width: 100%; transition: transform .15s ease; }
.tl-wrap.is-panning .tl-grid { transition: none; }   /* während des Ziehens 1:1, kein Nachlauf */
.tl-row { display: flex; border-bottom: 1px solid var(--border); }
.tl-row:last-child { border-bottom: none; }
.tl-rescell { flex: 0 0 150px; width: 150px; padding: 4px 10px; font-size: 13px; font-weight: 400; display: flex; align-items: center;
  position: sticky; left: 0; z-index: 3; background: var(--surface); border-right: 1px solid var(--border); }
.tl-resclick { cursor: pointer; gap: 6px; }
.tl-rescell.is-sel { background: var(--primary-soft); font-weight: 600; box-shadow: inset 3px 0 0 var(--primary); }
body.dark .tl-rescell.is-sel { background: #14b8a61f; }
.tl-head { position: sticky; top: 0; z-index: 4; background: var(--surface); }
.tl-corner { z-index: 5; color: var(--muted); }
.tl-track-head { position: relative; height: 54px; }
.tl-headcoll { position: absolute; bottom: 0; height: 5px; background: var(--red-500); border-radius: 3px 3px 0 0; z-index: 2; pointer-events: none; opacity: .92; }
.tl-dayhead { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--border); cursor: pointer; user-select: none; }
.tl-dayhead:hover { background: var(--gray-50); }
.tl-dayhead.is-today { background: var(--teal-50); }
body.dark .tl-dayhead.is-today { background: #14b8a611; }
.tl-dayhead.is-today .tl-daylabel { color: var(--primary); }
.tl-daylabel { font-size: 14px; font-weight: 800; padding: 7px 9px 6px; color: var(--text); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.tl-dayhead.is-compact .tl-daylabel { font-size: 11px; font-weight: 700; padding: 5px 4px; text-align: center; }
.tl-headsel { position: absolute; top: 0; bottom: 0; background: rgba(14,149,148,.16); border: 1px solid var(--primary); pointer-events: none; z-index: 6; }
.hint-tip { font-size: 12px; }
@media (max-width: 720px) { .hint-tip { display: none; } }
.tl-hours { display: flex; }
.tl-hour { font-size: 12px; color: var(--muted); padding: 2px 0 0 3px; box-sizing: border-box; border-left: 1px solid var(--gray-100); }
.tl-track { position: relative; height: var(--tl-row-h, 34px); flex: 1; background: var(--gray-100); }
body.dark .tl-track { background: #ffffff08; }
/* Zeile unter dem Mauszeiger: Ressourcenzelle hervorheben (zur Orientierung). */
.tl-row:not(.tl-head):not(.tl-group):hover .tl-rescell { background: var(--primary-soft); }
body.dark .tl-row:not(.tl-head):not(.tl-group):hover .tl-rescell { background: #14b8a61f; }
/* Dekorative Overlays dürfen Klicks NICHT abfangen – sonst kein „neuer Termin" per Klick. */
/* „Offen"/buchbar = heller Teal-Streifen; geschlossen/nicht buchbar = graue Grundfläche der Spur. */
.tl-open { position: absolute; top: 0; bottom: 0; background: var(--teal-50); pointer-events: none; }
body.dark .tl-open { background: #14b8a622; }
.tl-line { position: absolute; top: 0; bottom: 0; border-left: 1px solid var(--gray-100); pointer-events: none; }
.tl-daysep { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--border); pointer-events: none; }
.tl-now { position: absolute; top: 0; bottom: 0; border-left: 2px solid var(--red-500); z-index: 2; pointer-events: none; }
.tl-appt { position: absolute; top: 3px; bottom: 3px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 7px; padding: 0 6px 0 10px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); display: flex; align-items: center; z-index: 1; }
.tl-appt:hover { filter: brightness(.97); z-index: 3; }
.tl-appt { cursor: grab; }
.tl-appt.is-dragsrc { opacity: .35; }
/* Schwebender Klon während des Verschiebens */
.tl-drag { position: fixed; z-index: 1000; pointer-events: none; display: flex; align-items: center; padding: 0 8px;
  border-radius: 7px; background: var(--primary); color: #fff; font-size: 11px; font-weight: 700; box-shadow: var(--shadow-lg);
  white-space: nowrap; overflow: hidden; opacity: .95; }
.tl-drag.is-blocked { background: var(--red-500); }
/* Gültige Ablagezeile hervorheben */
.tl-track.tl-drop { box-shadow: inset 0 0 0 2px var(--primary); }
.tl-wrap.is-panning { cursor: grabbing; user-select: none; }
.tl-wrap.is-panning .tl-appt { cursor: grabbing; }
/* Querreferenz-Farbstreifen (Therapeut in Raum-Zeile / Raum in Therapeuten-Zeile) */
.tl-appt-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 7px 0 0 7px; }
.tl-appt-t { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tl-appt.status-cancelled { opacity: .5; text-decoration: line-through; }
.tl-appt.status-pending { border-left-style: dashed; }
/* Kollision: Ressource doppelt belegt → rot */
.tl-appt.is-collision { border-color: var(--red-500); background: #fef2f2; }
body.dark .tl-appt.is-collision { background: #3a1414; }
.tl-appt .tl-warn { color: var(--red-500); flex: 0 0 auto; margin-right: 3px; font-size: 16px; }
/* Check-in-Ampel: Anamnese-Status am Termin */
.tl-amp { position: absolute; top: 3px; right: 3px; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--surface); }
.tl-amp-flagged { background: var(--red-500); cursor: pointer; }
.tl-amp-flagged:hover { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--red-500); }
.tl-amp-none { background: var(--amber-500); }
.cal-appt.is-collision { border-color: var(--red-500); background: #fef2f2; }
body.dark .cal-appt.is-collision { background: #3a1414; }
/* Verknüpfung Raum ↔ Personal: gleiche Buchung beim Überfahren hervorheben */
.tl-appt.is-linked { outline: 2px solid var(--primary); outline-offset: -1px; box-shadow: 0 0 0 3px var(--teal-100); z-index: 5; }
body.dark .tl-appt.is-linked { box-shadow: 0 0 0 3px rgba(45,212,191,.25); }
/* Gruppen-Kopfzeile (Räume / Mitarbeiter) */
.tl-group { background: var(--gray-50); border-bottom: 1px solid var(--border); }
.tl-groupcell { font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--gray-50); gap: 6px; }
.tl-grouptrack { height: 24px; background: var(--gray-50); }
.tl-abs { position: absolute; top: 3px; bottom: 3px; border-radius: 7px; overflow: hidden; display: flex; align-items: center; z-index: 1;
  background: repeating-linear-gradient(45deg, rgba(100,116,139,.18), rgba(100,116,139,.18) 6px, rgba(100,116,139,.30) 6px, rgba(100,116,139,.30) 12px); }
.tl-abs span { font-size: 10px; font-weight: 700; color: var(--gray-700); padding: 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Studioweite Sperrzeit / Firmenurlaub – rot über alle Zeilen */
.tl-abs-studio { background: repeating-linear-gradient(45deg, rgba(239,68,68,.20), rgba(239,68,68,.20) 7px, rgba(239,68,68,.36) 7px, rgba(239,68,68,.36) 14px); }
.tl-abs-studio span { color: var(--red-500); }

/* Abwesenheits-Liste im Modal */
.abs-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.abs-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: var(--gray-50); border-radius: var(--radius-sm); }
.modal-hr { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

@media (max-width: 560px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .hours-row { grid-template-columns: 64px 28px 1fr auto 1fr; gap: 6px; }
}

/* Mehrfach-Therapeuten-Auswahl im Termin-Dialog */
.staff-pick .check-list { max-height: 150px; }

/* ===================== Öffentliche Buchung ===================== */
.book-title { font-size: 22px; font-weight: 800; margin: 6px 0 14px; }
.book-sum { color: var(--muted); font-weight: 600; margin-bottom: 12px; }

/* Schrittanzeige */
.steps { display: flex; gap: 6px; margin: 6px 0 18px; }
.step { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; opacity: .5; }
.step.is-active, .step.is-done { opacity: 1; }
.step-n { width: 28px; height: 28px; border-radius: 50%; background: var(--gray-200); color: var(--gray-700);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; }
.step.is-active .step-n { background: var(--primary); color: #fff; }
.step.is-done .step-n { background: var(--teal-600); color: #fff; }
.step-l { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; }
.step.is-active .step-l { color: var(--primary); }

/* Auswahl-Karten (Anwendung/Therapeut) */
.pick-card { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 10px; color: var(--text); }
.pick-card:hover { border-color: var(--primary); }
.pick-check input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--primary); }
.book-crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; font-weight: 600; margin: -2px 0 14px; }
.book-crumb .crumb-sep { font-size: 16px; opacity: .6; }
.book-crumb span:last-child { color: var(--text); }
.next-day { font-weight: 700; font-size: 13px; color: var(--muted); margin: 12px 0 6px; }
.pick-main { flex: 1; min-width: 0; }
.pick-title { font-weight: 700; font-size: 16px; }
.pick-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.pick-meta { color: var(--primary-strong); font-size: 13px; font-weight: 600; margin-top: 6px; }
.pick-arrow { font-size: 24px; color: var(--gray-400); }

/* Zeit-Slots */
.slot-host { margin-top: 8px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.slot-btn { padding: 12px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface);
  color: var(--text); font-weight: 700; cursor: pointer; }
.slot-btn:hover { border-color: var(--primary); background: var(--primary-soft); }

/* Zusammenfassungs-Karte */
.book-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 14px 16px; margin-bottom: 16px; }
.book-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.book-row span { color: var(--muted); }
.book-row + .book-row { border-top: 1px solid var(--border); }

/* Bestätigung */
.book-done { text-align: center; }
.done-mark { width: 64px; height: 64px; border-radius: 50%; background: var(--green-500); color: #fff;
  font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 16px auto; box-shadow: var(--shadow-lg); }
.book-done .book-card { text-align: left; }

/* ---------- Desktop: volle Breite dynamisch nutzen (wie CURENA) ---------- */
@media (min-width: 1024px) {
  .view, .view.view-wide { max-width: none; padding-left: 28px; padding-right: 28px; }
  .app-header { padding-left: 28px; padding-right: 28px; }
  .app-bar { max-width: none; padding-left: 28px; padding-right: 28px; }
  .bottom-nav { padding-left: 24px; padding-right: 24px; }
  /* Belegungskalender soll die volle Höhe/Breite ausschöpfen */
  .tl-wrap { max-height: 78vh; }
}

/* ---------- Abschnitts-Kopf mit Zurück ---------- */
.section-head-left { display: flex; align-items: center; gap: 8px; min-width: 0; }

/* ---------- Einstellungen: Stammdaten-Hub ---------- */
.set-list { display: flex; flex-direction: column; }
.set-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; cursor: pointer;
  background: transparent; border: none; border-top: 1px solid var(--border); padding: 14px 2px; color: var(--text); }
.set-row:first-child { border-top: none; }
.set-row:hover { color: var(--primary); }
.set-ico { font-size: 24px; color: var(--primary); flex: 0 0 auto; }
.set-row-main { flex: 1; min-width: 0; }
.set-row-title { font-weight: 700; font-size: 15px; }
.set-row .mi:last-child { color: var(--gray-400); }

/* ---------- Berichte ---------- */
.rep-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.rep-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.rep-kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 10px; text-align: center; }
.rep-num { font-size: 22px; font-weight: 800; color: var(--primary); }
.rep-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rep-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--border); }
.rep-row:first-of-type { border-top: none; }
.rep-row-key { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rep-row-val { color: var(--muted); font-size: 13px; white-space: nowrap; }
@media (max-width: 560px) { .rep-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Anamnese-Formular ---------- */
.q-block { padding: 10px 0; border-top: 1px solid var(--border); }
.q-block:first-of-type { border-top: none; }
.q-label { font-weight: 600; font-size: 15px; margin-bottom: 8px; }
.q-yesno { display: flex; gap: 10px; }
.radio { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; font-size: 14px; }
.radio input { accent-color: var(--primary); }
.q-followups { margin: 8px 0 2px; padding: 10px 12px; background: var(--gray-50); border-radius: var(--radius-sm); display: flex; flex-direction: column; gap: 6px; }
.consent-text { font-size: 13px; color: var(--gray-700); margin-bottom: 10px; line-height: 1.5; }
.sig-wrap { position: relative; }
.sig-canvas { width: 100%; height: 170px; border: 1px dashed var(--gray-300); border-radius: var(--radius-sm); background: var(--white); touch-action: none; cursor: crosshair; display: block; }
.sig-clear { position: absolute; top: 8px; right: 8px; }

/* ---------- Kundenakte / Anamnese-Verwaltung ---------- */
.kv-row { display: flex; gap: 12px; padding: 5px 0; }
.kv-k { color: var(--muted); min-width: 120px; flex: 0 0 auto; font-weight: 600; font-size: 13px; }
.badge-red { background: #fef2f2; color: var(--red-500); }
body.dark .badge-red { background: #3a1414; }
.amp { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: var(--radius-sm); font-weight: 600; font-size: 14px; margin-bottom: 12px; }
.amp .mi { flex: 0 0 auto; }
.amp-green { background: var(--teal-50); color: var(--teal-800); }
body.dark .amp-green { background: #10302f; color: var(--teal-500); }
.amp-red { background: #fef2f2; color: var(--red-500); }
body.dark .amp-red { background: #3a1414; }
.amp-grey { background: var(--gray-100); color: var(--muted); }
.qr-center { display: flex; justify-content: center; margin: 6px 0 14px; }
.qr-box svg { width: 200px; height: 200px; max-width: 70vw; }
.qr-box { background: #fff; padding: 8px; border-radius: var(--radius-sm); }
.intake-answers { display: flex; flex-direction: column; }
.intake-sig { display: block; max-width: 100%; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; margin-top: 6px; }

/* Kiosk-/Tablet-Modus */
.kiosk-overlay { position: fixed; inset: 0; z-index: 70; background: var(--bg); display: flex; flex-direction: column; }
.kiosk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--primary); color: #fff; font-weight: 600; }
.kiosk-bar .mi { flex: 0 0 auto; }
.kiosk-bar span { flex: 1; min-width: 0; }
.kiosk-bar .btn { background: #fff; color: var(--primary); border: none; }
.kiosk-frame { flex: 1; width: 100%; border: none; }

/* Fragebogen-Builder */
.bld-q { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; }
.bld-head { display: flex; gap: 8px; align-items: center; }
.bld-head input { flex: 1; }
.bld-head select { flex: 0 0 130px; }
.bld-sub { display: flex; gap: 12px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.bld-sub .check { padding: 0; flex: 0 0 auto; }
.bld-sub input { flex: 1; min-width: 160px; }
.bld-fu { margin: 10px 0 0 16px; padding-left: 10px; border-left: 2px solid var(--border); display: flex; flex-direction: column; gap: 6px; }
.bld-fu-row { display: flex; gap: 6px; align-items: center; }
.bld-fu-row input { flex: 1; }
.bld-fu-row select { flex: 0 0 110px; }
@media (max-width: 560px) { .bld-head select { flex-basis: 100px; } .kv-k { min-width: 90px; } }

/* ---------- Terminfinder ---------- */
.dash-new { margin-bottom: 16px; }
.fnd-group { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.fnd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.fnd-slot { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 8px 10px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); text-align: left; }
.fnd-slot:hover { border-color: var(--primary); background: var(--primary-soft); }
.fnd-slot.is-exact { border-color: var(--primary); box-shadow: 0 0 0 2px var(--teal-100); }
.fnd-slot.is-pref { border-left: 4px solid var(--primary); }
.fnd-time { font-weight: 800; font-size: 16px; }
.fnd-subday { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 0 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.fnd-more { display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%; margin-top: 10px; cursor: pointer;
  background: var(--primary-soft); color: var(--primary-strong); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 8px; font-weight: 700; font-size: 14px; }
.fnd-more:hover { border-color: var(--primary); }
.fnd-more:disabled { opacity: .6; cursor: default; }
.fnd-more .mi { font-size: 20px; }
.fnd-who { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.fnd-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin: 4px 0 10px; border-radius: var(--radius-sm);
  background: #fdecea; border: 1px solid #f5c2bd; color: #a02019; font-size: 14px; font-weight: 600; }
.fnd-note .mi { font-size: 20px; flex: 0 0 auto; }
.fnd-note.is-info { background: #fff6e5; border-color: #f3d28a; color: #8a5a00; }
.cmb { position: relative; }
.cmb-list { position: absolute; left: 0; right: 0; top: calc(100% + 2px); z-index: 50; max-height: 240px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: 0 8px 24px rgba(0,0,0,.12); }
.cmb-opt { padding: 8px 10px; cursor: pointer; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmb-opt:hover { background: var(--primary-soft); }
.cmb-opt.cmb-muted { color: var(--muted); }
.multi-row { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.multi-row > .cmb, .multi-row > div, .multi-row > select { flex: 1 1 auto; min-width: 0; }
.multi-idx { flex: 0 0 auto; min-width: 20px; padding-top: 9px; font-weight: 700; color: var(--muted); font-size: 13px; }
