/* Website (öffentlich) – vor den Team-Styles importieren */
@import "./fonts.css";
@import "./wunderwerk.css";
@import "./booking.css";
:root {
  /* Team-Bereich – Farb-Tokens (Hell) */
  --bg: #FAF7F2;          /* Seitengrund */
  --surface: #FFFFFF;     /* Karten */
  --cream: #F4EEE4;       /* eingesenkte Fläche / Inputs / Chips */
  --ink: #2A2520;         /* Primärtext */
  --mid: #5C5048;         /* Sekundärtext */
  --faint: #9A9084;       /* dezenter Text */
  --border: #E4DBCE;      /* Rahmen */
  --gold: #B89A6A;
  --gold-bg: #F5EDD8;
  --dark: #2A2520;        /* dunkle Brand-Fläche (Nav/Buttons/Login) */
  --nav-bg: #1A1A1A;
  --white: #FFFFFF;       /* echtes Weiß (Text auf Farbe) */
  --error: #B05A4A;
  --green: #5A8A6A;
  --overlay: rgba(0, 0, 0, .35);
  /* Status-Tönungen */
  --tint-ok-bg: #EEF6F0;      --tint-ok-line: #5A8A6A;   --tint-ok-ink: #2D5A3A;
  --tint-crit-bg: #FDEAEA;    --tint-crit-line: #C0392B; --tint-crit-ink: #8B2020;
  --tint-pend-bg: #FDF8EE;    --tint-pend-line: #D4A84A; --tint-pend-ink: #8A6A2A;
  --tint-block-bg: #EEEEEE;   --tint-block-line: #CCCCCC;
}

/* Team-Bereich – Dunkel */
.page[data-theme="dark"] {
  --bg: #15120E;
  --surface: #211D17;
  --cream: #272219;
  --ink: #ECE4D8;
  --mid: #B4AA97;
  --faint: #8A7F70;
  --border: rgba(240, 232, 220, .12);
  --gold: #C8AA78;
  --gold-bg: rgba(200, 170, 120, .16);
  --dark: #100E0B;
  --nav-bg: #100E0B;
  --error: #E08272;
  --green: #7FB08F;
  --overlay: rgba(0, 0, 0, .6);
  --tint-ok-bg: rgba(127, 176, 143, .16);   --tint-ok-line: #7FB08F;   --tint-ok-ink: #A8D3B6;
  --tint-crit-bg: rgba(224, 130, 114, .18); --tint-crit-line: #E08272; --tint-crit-ink: #F0B2A8;
  --tint-pend-bg: rgba(212, 168, 74, .16);  --tint-pend-line: #D4A84A; --tint-pend-ink: #E6C98A;
  --tint-block-bg: rgba(255, 255, 255, .06); --tint-block-line: rgba(255, 255, 255, .2);
}
body:has(.page[data-theme="dark"]) { background: #15120E; }

* { box-sizing: border-box; margin: 0; padding: 0; }

html {
  overflow-x: hidden;
  max-width: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Öffentliche Website: Theme-Variablen aus wunderwerk.css */
body:has(.ww-site) {
  background: var(--bg);
  color: var(--ink);
  font-weight: 300;
}

/* === Login === */
.login-page {
  /* Login/Setup sind immer dunkel – unabhängig vom Website-Theme */
  --dark: #100E0B;
  --surface: #211D17;
  --cream: #272219;
  --ink: #ECE4D8;
  --mid: #B4AA97;
  --border: rgba(240, 232, 220, .14);
  --gold: #C8AA78;
  --error: #E08272;
  --tint-crit-bg: rgba(224, 130, 114, .18);
  --tint-crit-line: #E08272;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--dark);
  color: var(--ink);
  position: relative;
  overflow: hidden;
}

/* Großes, langsam drehendes Logo als Hintergrund */
.login-bg-mark {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(88vmin, 760px);
  height: min(88vmin, 760px);
  max-width: none;
  opacity: .13;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  animation: login-bg-spin 90s linear infinite;
}
@keyframes login-bg-spin {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .login-bg-mark { animation: none; }
}

.login-card {
  background: var(--surface);
  padding: 52px 44px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  position: relative;
  z-index: 1;
}

.login-logo img { height: 36px; margin-bottom: 36px; }

.login-card h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 8px;
}

.login-sub { font-size: 13px; color: var(--mid); margin-bottom: 28px; }

.passkey-setup-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  margin-bottom: 8px;
}
.passkey-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--dark);
}
.passkey-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid color-mix(in srgb, var(--mid) 35%, transparent);
  border-radius: 10px;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  background: var(--white);
  color: var(--dark);
}
.passkey-input:focus {
  outline: 2px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-color: var(--gold);
}
.passkey-hint {
  margin: 0 0 8px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--mid);
}

.btn-passkey {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--dark);
  color: var(--white);
  border: 2px solid var(--dark);
  padding: 14px;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  margin-bottom: 12px;
}
.btn-passkey svg { width: 18px; height: 18px; }
.btn-passkey:hover { background: var(--white); color: var(--dark); }

.btn-text {
  background: none;
  border: none;
  color: var(--mid);
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  cursor: pointer;
  padding: 8px;
  width: 100%;
  text-decoration: underline;
}

.reg-form input {
  width: 100%;
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 12px 14px;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  margin-bottom: 14px;
  outline: none;
}
.reg-form input:focus { border-color: var(--gold); background: var(--surface); }

.error-box {
  background: var(--tint-crit-bg);
  border: 1px solid var(--tint-crit-line);
  color: var(--error);
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  text-align: left;
}

/* === Dashboard Layout === */
.dashboard { min-height: 100vh; }

.dash-header {
  background: var(--dark);
  color: var(--white);
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

.dash-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 500;
  color: var(--white);
  text-decoration: none;
  letter-spacing: 2px;
}

.dash-header-right { display: flex; gap: 20px; align-items: center; }

.dash-nav-link {
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.dash-nav-link:hover { color: var(--white); }

/* === Greeting === */
.dash-greeting {
  background: var(--gold);
  padding: 40px 24px 36px;
  text-align: center;
}

.dash-greeting h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 400;
  color: var(--white);
  margin-bottom: 10px;
}

.next-appt {
  font-size: 15px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 14px;
}

.next-appt strong { color: var(--white); font-weight: 500; }

.ical-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  border: 1px solid rgba(255,255,255,0.4);
  padding: 7px 14px;
}
.ical-link svg { width: 14px; height: 14px; }
.ical-link:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.badge-warn {
  display: inline-block;
  background: rgba(255,255,255,0.2);
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 10px;
  font-family: 'Jost', sans-serif;
  font-weight: 400;
  vertical-align: middle;
  margin-left: 8px;
}

/* === Sections === */
.dash-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 20px;
}

.dash-section h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  background: var(--gold-bg);
  color: var(--gold);
  border: 1px solid var(--border);
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
}

/* === Schedule Grid === */
.schedule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.schedule-card {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 18px 16px;
}

.schedule-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.appt-list { list-style: none; }
.appt-list li {
  display: flex;
  gap: 10px;
  padding: 6px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.appt-list li:last-child { border-bottom: none; }
.appt-time { color: var(--mid); min-width: 42px; }
.appt-client { font-weight: 400; }

.no-appts { font-size: 13px; color: var(--mid); font-style: italic; }

/* === Survey Generator === */
.survey-gen-input {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 4px 4px 12px;
}

.survey-gen-input input {
  flex: 1;
  border: none;
  background: none;
  font-family: 'Jost', sans-serif;
  font-size: 14px;
  font-weight: 300;
  outline: none;
  color: var(--ink);
}

.btn-mic {
  background: none;
  border: none;
  color: var(--mid);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
}
.btn-mic svg { width: 18px; height: 18px; }
.btn-mic:hover { color: var(--gold); }
.btn-mic.listening { color: var(--error); }

.btn-generate {
  background: var(--dark);
  color: var(--white);
  border: none;
  padding: 10px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.btn-generate:hover:not(:disabled) { background: var(--gold); }
.btn-generate:disabled { opacity: 0.5; cursor: default; }

.survey-result {
  margin-top: 12px;
  padding: 14px 16px;
  background: var(--gold-bg);
  border: 1px solid var(--border);
  font-size: 14px;
}

.survey-hint { font-size: 12px; color: var(--mid); margin-top: 4px; }

.survey-error {
  margin-top: 8px;
  font-size: 13px;
  color: var(--error);
}

.btn-text-sm {
  background: none;
  border: none;
  color: var(--mid);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  margin-top: 8px;
}

/* === Survey Cards === */
.survey-list-dash {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.survey-card-dash {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 16px;
}

.survey-name { font-weight: 500; font-size: 14px; margin-bottom: 2px; }
.survey-date { font-size: 12px; color: var(--mid); margin-bottom: 8px; }

.survey-answers { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }

.answer-chip {
  background: var(--cream);
  border: 1px solid var(--border);
  padding: 3px 8px;
  font-size: 11px;
  color: var(--mid);
  border-radius: 2px;
}

.survey-comment {
  font-size: 13px;
  color: var(--mid);
  font-style: italic;
  margin-top: 4px;
}

.link-all {
  display: inline-block;
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--gold);
  text-decoration: none;
}
.link-all:hover { text-decoration: underline; }

.empty-hint { color: var(--mid); font-size: 14px; font-style: italic; }

/* === Settings === */
.settings-user {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.settings-label { font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--mid); margin-bottom: 4px; }
.settings-value { font-size: 15px; }

.settings-block h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 17px;
  font-weight: 500;
  margin-bottom: 14px;
}

.passkey-list { list-style: none; margin-bottom: 16px; }
.passkey-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  color: var(--mid);
}
.passkey-list li svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--gold); }

.btn-passkey-small {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--ink);
  padding: 10px 16px;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  margin-top: 8px;
}
.btn-passkey-small svg { width: 14px; height: 14px; }
.btn-passkey-small:hover { border-color: var(--gold); color: var(--gold); }

.success-box {
  background: var(--tint-ok-bg);
  border: 1px solid var(--tint-ok-line);
  color: var(--tint-ok-ink);
  padding: 10px 14px;
  font-size: 13px;
  margin: 12px 0;
}

/* === Flash === */
.flash-group { position: fixed; top: 70px; right: 16px; z-index: 200; }
.flash {
  padding: 12px 16px;
  font-size: 13px;
  margin-bottom: 8px;
  border-radius: 2px;
  max-width: 320px;
}
.flash-error { background: var(--tint-crit-bg); border: 1px solid var(--tint-crit-line); color: var(--error); }
.flash-info { background: var(--gold-bg); border: 1px solid var(--border); color: var(--ink); }

/* === Mobile === */
@media (max-width: 600px) {
  .dash-greeting h1 { font-size: 24px; }
  .schedule-grid { grid-template-columns: 1fr; }
  .survey-gen-input { flex-wrap: wrap; }
  .btn-generate { width: 100%; }
}

/* ───────────────────────────────────────────────────────────
   Gemeinsamer App-Header (Menüband + Hero) — gilt für alle Team-Seiten
   ─────────────────────────────────────────────────────────── */
.page {
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
}

.app-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  max-width: 100%;
  padding: .7rem 1rem;
  background: var(--nav-bg);
  position: sticky;
  top: 0;
  z-index: 50;
}
.app-logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  color: #B89A6A;
  text-decoration: none;
  min-width: 0;
}
@keyframes app-logo-spin { to { transform: rotate(360deg); } }
.app-logo-mark {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  animation: app-logo-spin 18s linear infinite;
}
.app-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}
.app-logo-name {
  font-size: .85rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.app-logo-team {
  color: rgba(184, 154, 106, .55);
  font-weight: 500;
}
.app-logo-sub {
  font-size: .58rem;
  letter-spacing: .28em;
  text-transform: uppercase;
  font-weight: 500;
  color: rgba(184, 154, 106, .7);
  white-space: nowrap;
}
@media (prefers-reduced-motion: reduce) {
  .app-logo-mark { animation: none; }
}

/* Hamburger-Menü */
.app-nav-menu { position: relative; flex-shrink: 0; }
.app-nav-toggle {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 8px;
  background: transparent;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}
.app-nav-toggle::-webkit-details-marker { display: none; }
.app-nav-toggle::marker { content: ""; }
.app-nav-toggle:hover { border-color: rgba(184,154,106,.5); }

/* Theme-Umschalter (in der dunklen Nav) */
.app-nav-actions { display: flex; align-items: center; gap: .5rem; flex-shrink: 0; }

/* Inbox-Icon mit Ungelesen-Badge */
.app-inbox {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 8px;
  color: rgba(255,255,255,.82); text-decoration: none;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06);
  transition: background .15s, border-color .15s, color .15s;
}
.app-inbox:hover { background: rgba(255,255,255,.12); border-color: rgba(184,154,106,.55); color: #fff; }
.app-inbox-badge {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: .62rem; font-weight: 700; line-height: 1;
  color: #1B1916; background: #C8AA78; border-radius: 20px;
}
.app-nav-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 17px; height: 17px; padding: 0 5px; margin-left: .5rem;
  font-size: .62rem; font-weight: 700; color: #1B1916; background: #C8AA78; border-radius: 20px;
}
.app-theme-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.15);
  color: rgba(255,255,255,.82);
  padding: .38rem .62rem; border-radius: 8px; cursor: pointer;
  font-family: inherit; font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
  line-height: 1; transition: background .15s, border-color .15s, color .15s;
}
.app-theme-toggle:hover { background: rgba(255,255,255,.12); border-color: rgba(184,154,106,.55); color: #fff; }
.app-theme-ico { display: block; flex-shrink: 0; }
.app-theme-ico--sun { display: none; }
.app-theme-ico--moon { display: block; }
.page[data-theme="dark"] .app-theme-ico--sun { display: block; }
.page[data-theme="dark"] .app-theme-ico--moon { display: none; }
@media (max-width: 480px) {
  .app-theme-toggle-lbl { display: none; }
}

.app-nav-toggle-icon {
  display: block;
  width: 18px;
  height: 2px;
  background: #B89A6A;
  border-radius: 1px;
  position: relative;
}
.app-nav-toggle-icon::before,
.app-nav-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: #B89A6A;
  border-radius: 1px;
}
.app-nav-toggle-icon::before { top: -6px; }
.app-nav-toggle-icon::after { top: 6px; }

.app-nav-panel {
  position: absolute;
  top: calc(100% + .5rem);
  right: 0;
  min-width: 12rem;
  background: #242424;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 10px;
  padding: .35rem 0;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 28px rgba(0,0,0,.35);
  z-index: 100;
}

.app-nav-link {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  font-size: .82rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  transition: background .15s, color .15s;
  padding: .7rem 1.1rem;
  white-space: nowrap;
}
.app-nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,.06);
}
.app-nav-link.is-active { color: #B89A6A; font-weight: 600; }
.app-nav-link--muted { color: rgba(255,255,255,.45); border-top: 1px solid rgba(255,255,255,.08); margin-top: .25rem; padding-top: .85rem; }

.app-hero {
  width: 100%;
  max-width: 100%;
  background: #B89A6A;
  text-align: center;
  padding: 1.1rem 1rem 1.5rem;
  margin-bottom: 1.5rem;
}
.app-hero-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(1.45rem, 5vw, 2.1rem);
  font-weight: 300;
  color: #fff;
  margin: 0 0 .25rem;
  letter-spacing: .02em;
  line-height: 1.2;
  word-break: break-word;
}
.app-hero-sub {
  color: rgba(255,255,255,.85);
  font-size: clamp(.8rem, 2.8vw, .9rem);
  margin: 0;
  line-height: 1.45;
  padding: 0 .25rem;
}
.app-hero-sub strong { color: #fff; font-weight: 600; }

.app-main {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 3rem;
  overflow-x: hidden;
}

/* ── Assistent: Terminliste mit Link-Buttons ──────────────── */
.appt-list { margin-top: 1rem; display: flex; flex-direction: column; gap: .5rem; }
.appt-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .7rem .9rem; background: var(--cream);
  border: 1px solid var(--border); border-radius: 10px;
  flex-wrap: wrap;
}
.appt-info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.appt-when { font-size: .78rem; color: var(--faint); }
.appt-client { font-size: .95rem; font-weight: 500; color: var(--ink); }
.appt-treat { font-size: .82rem; color: #B89A6A; }
.btn-gold-sm {
  background: #B89A6A; color: #fff; border: none; white-space: nowrap;
  padding: .45rem .9rem; border-radius: 8px; cursor: pointer;
  font-size: .78rem; letter-spacing: .03em; transition: background .2s;
}
.btn-gold-sm:hover { background: #a8895c; }

.link-box {
  margin-top: 1rem; padding: .8rem 1rem; background: var(--cream); border-radius: 10px;
}
.link-box-label { font-size: .82rem; color: var(--mid); margin-bottom: .45rem; }
.link-box-label + .link-box-row { margin-bottom: .75rem; }
.link-box-row { display: flex; gap: .5rem; align-items: center; }
.link-box-url {
  flex: 1; min-width: 0; padding: .5rem .7rem; border: 1px solid var(--border);
  border-radius: 6px; font-size: .82rem; color: var(--mid); background: var(--surface);
}
.copy-btn.copied { background: #2d7a4f; }
.copy-msg-btn.copied { background: #2d7a4f; }

.link-box-message {
  width: 100%; padding: .65rem .75rem; border: 1px solid var(--border);
  border-radius: 6px; font-size: .82rem; color: var(--ink); background: var(--surface);
  line-height: 1.45; resize: vertical; min-height: 6rem; margin-bottom: .65rem;
  font-family: inherit;
}
.link-box-actions {
  display: flex; flex-wrap: wrap; gap: .5rem; align-items: center;
}
.btn-whatsapp {
  display: inline-flex; align-items: center; justify-content: center;
  background: #25D366; color: #fff; text-decoration: none; border: none;
  padding: .45rem .9rem; border-radius: 8px; font-size: .78rem;
  letter-spacing: .03em; transition: background .2s; white-space: nowrap;
  cursor: pointer; font-family: inherit;
}
.btn-whatsapp:hover { background: #1ebe57; color: #fff; }
.btn-channel {
  width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px; cursor: pointer; padding: 0;
}
.btn-channel svg { width: 18px; height: 18px; }
.btn-email { background: #4a6fa5; color: #fff; }
.btn-email:hover { background: #3d5d8a; color: #fff; }
.survey-channel-btns { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
.survey-modal { max-width: 520px; }
.survey-modal-email { font-size: .78rem; margin: .75rem 0 0; }
.link-box-hint { font-size: .78rem; color: var(--faint); font-style: italic; }
.contact-consent-hints { margin-top: .65rem; display: flex; flex-direction: column; gap: .35rem; }
.contact-consent-warn {
  margin: 0; font-size: .78rem; line-height: 1.35;
  color: var(--tint-crit-line);
  background: var(--tint-crit-bg);
  border: 1px solid var(--tint-crit-line);
  border-radius: 6px;
  padding: .45rem .65rem;
}
.contact-consent-warn--inline {
  display: block; margin-top: .35rem; padding: .3rem .5rem; font-size: .72rem;
}
.contacts-consent-bar { margin: .55rem 0 0; }

/* ── Breites Layout (GF / Kalender) ───────────────────────── */
.app-main--wide {
  max-width: none;
  width: 100%;
  padding-left: clamp(0.75rem, 2vw, 1.5rem);
  padding-right: clamp(0.75rem, 2vw, 1.5rem);
}

/* ── Zufriedenheit (Dashboard) ─────────────────────────────── */
.sat-summary { display: flex; flex-direction: column; gap: 1rem; }
.sat-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.sat-kpi { background: var(--cream); border: 1px solid var(--border); border-radius: 10px; padding: .9rem 1rem; }
.sat-kpi-val { display: block; font-size: 1.35rem; font-weight: 600; color: var(--ink); }
.sat-kpi-val.sat-warn { color: var(--tint-crit-line); }
.sat-kpi-lbl { font-size: .72rem; color: var(--faint); margin-top: .2rem; display: block; }
.sat-sub { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0; }
.sat-alerts { list-style: none; display: flex; flex-direction: column; gap: .45rem; margin: 0; padding: 0; }
.sat-alert { font-size: .82rem; padding: .55rem .75rem; border-radius: 8px; background: var(--cream); border: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: baseline; }
.sat-alert--critical { border-color: var(--tint-crit-line); background: var(--tint-crit-bg); }
.sat-alert--pending { border-color: var(--tint-pend-line); background: var(--tint-pend-bg); }
.sat-stars { font-weight: 700; color: var(--tint-crit-line); }
.sat-comment { color: var(--mid); font-style: italic; }

/* ── Nachsorge (Folgetermin) ────────────────────────────────── */
.followups-kpis { grid-template-columns: repeat(3, 1fr); }
.followups-toolbar { display: flex; flex-direction: column; gap: .75rem; margin-bottom: 1.1rem; }
.followups-toolbar-top {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.followups-filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.35rem;
}
.followups-filter-tools {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.35rem;
  width: 100%;
  padding-top: .55rem;
  margin-top: .15rem;
  border-top: 1px solid var(--border);
}
.followups-filter-group {
  display: flex; flex-direction: column; align-items: flex-start; gap: .28rem;
}
.followups-filter-lbl {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .07em; color: var(--faint); line-height: 1;
}
.followups-filter-btns { display: flex; flex-wrap: wrap; gap: .3rem; }
.followups-filter {
  background: var(--surface); border: 1px solid var(--border); color: var(--mid);
  padding: .35rem .7rem; border-radius: 6px; cursor: pointer; font-size: .78rem; font-family: inherit;
}
.followups-filter:hover { background: var(--cream); }
.followups-filter.is-active { background: var(--gold); color: #fff; border-color: var(--gold); }
.followups-search input, .followups-sort select {
  padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  font-size: .82rem; font-family: inherit; background: var(--surface); color: var(--ink);
}
.followups-search input { min-width: 10rem; }
.followups-refresh-btn { align-self: flex-end; margin-bottom: .05rem; }
.followups-hint { font-size: .75rem; margin: 0; }
.followups-head {
  display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.followups-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.followups-row {
  padding: .75rem .9rem; border-radius: 10px; background: var(--cream);
  border: 1px solid var(--border); display: flex; flex-direction: column; gap: .35rem;
  min-width: 0;
}
.followups-row--overdue {
  border-color: var(--tint-crit-line); background: var(--tint-crit-bg);
  box-shadow: 0 0 0 1px var(--tint-crit-line);
}
.followups-row--dismissed {
  opacity: .72;
  border-style: dashed;
}
.followups-badge--dismissed {
  background: var(--mid); color: #fff;
}
.followups-dismiss-btn {
  white-space: nowrap;
}
.followups-row-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.followups-row-main { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; min-width: 0; }
.followups-row-actions { display: flex; gap: .35rem; flex-shrink: 0; }
.followups-name { font-weight: 600; color: var(--ink); font-size: .95rem; }
.followups-badge {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .2rem .45rem; border-radius: 4px;
  background: var(--tint-crit-line); color: #fff;
}
.followups-badge--voucher {
  background: #f3e8d8;
  color: #7a4a12;
  border-color: #e0c9a0;
}
.followups-badge--pattern {
  background: #e4efe6;
  color: #2d5a38;
  border-color: #b9d4c0;
}
.followups-badge--emerging {
  background: #e8eef6;
  color: #2c4a6e;
  border-color: #b8c9de;
}
.followups-badge--sparse {
  background: #f5e8e8;
  color: #7a3030;
  border-color: #e0b8b8;
}
.followups-row--clickable { cursor: pointer; }
.followups-row--clickable:hover { border-color: var(--gold); }
.followups-detail-backdrop .followups-detail-panel {
  max-width: min(36rem, 96vw);
  max-height: 90vh;
  overflow-y: auto;
}
.followups-detail-rhythm {
  font-size: .88rem;
  color: var(--ink);
  margin: 0 0 .4rem;
  line-height: 1.35;
}
.followups-detail-voucher {
  font-size: .82rem;
  color: #7a4a12;
  margin: 0 0 .75rem;
}
.followups-detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: 1rem;
}
.followups-detail-h {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  margin: 0 0 .55rem;
}
.followups-journal-month { margin-bottom: 1rem; }
.followups-journal-month-lbl {
  font-weight: 600;
  font-size: .9rem;
  margin-bottom: .4rem;
  color: var(--ink);
}
.followups-journal-visit {
  border: 1px solid var(--border);
  border-radius: .4rem;
  padding: .55rem .65rem;
  margin-bottom: .45rem;
  background: var(--cream, #faf8f5);
}
.followups-journal-visit-head {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem .55rem;
  font-size: .78rem;
  color: var(--mid);
  margin-bottom: .35rem;
}
.followups-journal-status {
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--ink);
  font-size: .68rem;
}
.followups-journal-items {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: .82rem;
}
.followups-journal-items li {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  padding: .12rem 0;
}
.followups-journal-total {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .4rem;
  margin-top: .4rem;
  padding-top: .35rem;
  border-top: 1px solid var(--border);
  font-size: .85rem;
}
.followups-journal-receipt-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: .3rem;
  font-size: .72rem;
  padding: .15rem .45rem;
  cursor: pointer;
  color: var(--mid);
}
.followups-journal-receipt {
  margin-top: .4rem;
  font-size: .78rem;
  color: var(--mid);
}
.followups-badge--regular {
  background: color-mix(in srgb, var(--gold) 85%, #000); color: #fff;
}
.followups-badge--once {
  background: var(--border); color: var(--mid);
}
.followups-row-meta {
  display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .82rem; color: var(--mid);
}
.followups-row-stats {
  display: flex; flex-wrap: wrap; gap: .35rem 1rem; font-size: .8rem; color: var(--ink);
  align-items: center;
}
.followups-revenue {
  color: var(--ink);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .1rem;
  text-align: right;
}
.followups-revenue-lbl {
  font-size: .68rem;
  font-weight: 500;
  color: var(--mid);
}

/* Breit: Filter | KPIs nebeneinander; Kacheln mit fester Breite */
.followups-page .followups-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 32rem);
  gap: .65rem;
  justify-content: start;
}
.followups-page .followups-row {
  width: 32rem;
  max-width: 100%;
  box-sizing: border-box;
}

@media (min-width: 960px) {
  .followups-page .followups-toolbar-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem 1.25rem;
    align-items: start;
  }
  .followups-page .followups-kpis {
    grid-template-columns: repeat(3, minmax(7.5rem, 10.5rem));
    gap: .55rem;
  }
  .followups-page .followups-kpis .sat-kpi {
    padding: .65rem .85rem;
  }
  .followups-page .followups-kpis .sat-kpi-val {
    font-size: 1.25rem;
  }
  .followups-page .followups-row {
    padding: .7rem .8rem;
  }
  .followups-page .followups-name {
    font-size: .9rem;
  }
  .followups-page .followups-row-meta,
  .followups-page .followups-row-stats {
    font-size: .78rem;
  }
}
@media (max-width: 959px) {
  .followups-page .followups-kpis { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .followups-page .followups-list {
    grid-template-columns: 1fr;
  }
  .followups-page .followups-row {
    width: 100%;
  }
}
@media (max-width: 640px) {
  .followups-page .followups-kpis { grid-template-columns: 1fr; }
}

.contacts-row { cursor: pointer; }
.contacts-search { flex: 1; min-width: 12rem; }
.contacts-channels { display: flex; gap: .25rem; flex-wrap: wrap; }
.contacts-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, 14rem);
  gap: .75rem;
  justify-content: start;
  width: 100%;
}
.contacts-tile {
  width: 14rem;
  box-sizing: border-box;
  margin: 0;
  padding: .85rem .9rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel, var(--surface, #fff));
  box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  min-height: 6.25rem;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
[data-theme="dark"] .contacts-tile {
  background: var(--panel, rgba(255, 255, 255, .04));
  box-shadow: none;
}
.contacts-tile:hover,
.contacts-tile:focus-visible {
  border-color: var(--gold, #b8954a);
  box-shadow: 0 4px 14px rgba(0, 0, 0, .08);
  outline: none;
  transform: translateY(-1px);
}
.contacts-tile-name {
  font-weight: 650;
  font-size: .92rem;
  line-height: 1.25;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.contacts-dormant {
  margin-right: .15rem;
  opacity: .9;
}
.contacts-tile-meta {
  font-size: .75rem;
  color: var(--mid);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.contacts-tile-meta--email { opacity: .9; }
.contacts-tile .contacts-channels { margin-top: auto; padding-top: .2rem; }
.contacts-tile-head {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.contacts-tile-meta-row {
  display: flex;
  flex-direction: column;
  gap: .2rem;
}

@media (max-width: 720px) {
  .contacts-grid {
    grid-template-columns: 1fr;
    gap: .55rem;
  }
  .contacts-tile {
    width: 100%;
    min-height: 0;
    padding: .75rem 1rem;
    background: var(--cream);
    box-shadow: none;
    gap: .35rem;
  }
  [data-theme="dark"] .contacts-tile {
    background: var(--panel, rgba(255, 255, 255, .04));
  }
  .contacts-tile:hover,
  .contacts-tile:focus-visible {
    transform: none;
    box-shadow: none;
  }
  .contacts-tile-head {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: .5rem;
  }
  .contacts-tile-name {
    font-size: .95rem;
    -webkit-line-clamp: unset;
    display: block;
    flex: 1;
    min-width: 0;
  }
  .contacts-tile .contacts-channels {
    margin-top: 0;
    padding-top: 0;
    flex-shrink: 0;
  }
  .contacts-tile-meta-row {
    flex-direction: row;
    flex-wrap: wrap;
    gap: .25rem .85rem;
    font-size: .82rem;
  }
  .contacts-tile-meta {
    white-space: normal;
  }
  .contacts-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .contacts-toolbar .followups-filter-group {
    width: 100%;
  }
  .contacts-search input {
    width: 100%;
  }
  .contacts-toolbar-count {
    width: 100%;
  }
}

.contacts-toolbar {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .65rem 1rem;
  margin-bottom: 1rem;
}
.contacts-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: .65rem 1.15rem;
  width: 100%;
}
.contacts-clear-filters {
  align-self: flex-end;
  margin-bottom: .05rem;
}
.contacts-toolbar .contacts-search {
  flex: 1 1 14rem;
  min-width: 12rem;
}
.contacts-toolbar .contacts-search input {
  width: 100%;
  box-sizing: border-box;
}
.contacts-new-btn {
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: .05rem;
}
.contacts-toolbar-count {
  margin: 0;
  flex: 1 1 auto;
  min-width: 8rem;
  align-self: center;
}
.followups-channel-tag--ok {
  border-color: color-mix(in srgb, #6aae7a 40%, var(--border));
  color: #4d8f5c;
  background: color-mix(in srgb, #6aae7a 10%, transparent);
}
.contacts-profile-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
  margin-bottom: .25rem;
}
.contacts-form-wrap { max-width: 40rem; }
.contacts-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
  margin-top: .75rem;
}
.contacts-form label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  font-size: .82rem;
  color: var(--mid);
}
.contacts-form input,
.contacts-form textarea,
.contacts-form select {
  font: inherit;
  color: var(--ink);
  background: var(--panel, var(--surface, #fff));
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: .55rem .65rem;
}
.contacts-form-full { grid-column: 1 / -1; }
.contacts-form-span2 { grid-column: 1 / -1; }
.contacts-form-actions {
  grid-column: 1 / -1;
  display: flex;
  gap: .65rem;
  align-items: center;
  margin-top: .25rem;
}
.contacts-gender {
  border: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  align-items: center;
}
.contacts-gender legend {
  font-size: .82rem;
  color: var(--mid);
  margin-bottom: .35rem;
  width: 100%;
}
.contacts-radio,
.contacts-check,
.contacts-switch {
  flex-direction: row !important;
  align-items: center;
  gap: .45rem !important;
  cursor: pointer;
}
.contacts-radio input,
.contacts-check input,
.contacts-switch input[type="checkbox"] {
  width: auto;
  padding: 0;
}
.contacts-mobile-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: .5rem;
}
.contacts-toggles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .55rem 1rem;
}
.contacts-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: .35rem .75rem .75rem;
  background: transparent;
}
.contacts-section > summary {
  cursor: pointer;
  font-size: .9rem;
  color: var(--ink);
  padding: .45rem 0;
  list-style: none;
}
.contacts-section > summary::-webkit-details-marker { display: none; }
.contacts-section > summary::before {
  content: "▸ ";
  color: var(--mid);
}
.contacts-section[open] > summary::before { content: "▾ "; }
.contacts-section-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem 1rem;
  margin-top: .35rem;
}
.contacts-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem 1rem;
  margin-top: .35rem;
}
.contacts-tags .contacts-tag-label {
  border-left: 3px solid transparent;
  padding-left: .4rem;
}
.contacts-dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem 1.25rem;
  margin: .5rem 0 0;
}
.contacts-dl dt {
  font-size: .75rem;
  color: var(--mid);
  margin: 0;
}
.contacts-dl dd {
  margin: .1rem 0 0;
  color: var(--ink);
}
.contacts-subhead {
  font-size: .95rem;
  margin: 1.1rem 0 .35rem;
  color: var(--ink);
}
.contacts-flags {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  font-size: .85rem;
  color: var(--mid);
}
.contacts-flags li.on { color: var(--ink); }
.contacts-tags-line { margin: 0; }
@media (max-width: 560px) {
  .contacts-form,
  .contacts-section-grid,
  .contacts-toggles,
  .contacts-dl { grid-template-columns: 1fr; }
}
.contacts-probe {
  margin-top: .75rem;
  padding: .75rem;
  font-size: .75rem;
  overflow: auto;
  max-height: 20rem;
  background: var(--surface-2, var(--bg));
  border: 1px solid var(--border);
  border-radius: 8px;
}
.contacts-csv .live-file-input, .contacts-csv input[type="file"] {
  display: block;
  margin-top: .35rem;
}
.followups-channel-tag {
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  padding: .15rem .4rem; border-radius: 4px; border: 1px solid var(--border); color: var(--mid);
}
.followups-channel-tag--warn {
  border-color: var(--tint-crit-line);
  color: var(--tint-crit-line);
  background: var(--tint-crit-bg);
}
.followups-days { font-weight: 600; color: var(--ink); }
.followups-days--warn, .followups-days-inline.followups-days--warn {
  color: var(--tint-crit-line); font-weight: 700;
}
.followups-days-inline { font-weight: 700; min-width: 2.5rem; }

/* ── Statistik ──────────────────────────────────────────────── */
.dash-section.stats-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1rem 0 1.5rem;
}

/* ── Kontakte ───────────────────────────────────────────────── */
.dash-section.contacts-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1rem 0 1.5rem;
}
.contacts-page { width: 100%; }
.page:has(.contacts-page) .app-main {
  max-width: none;
  width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* ── Nachsorge ──────────────────────────────────────────────── */
.dash-section.followups-page {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 1rem 0 1.5rem;
}
.followups-page { width: 100%; }
.page:has(.followups-page) .app-main {
  max-width: none;
  width: 100%;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}
.stats-page { width: 100%; }
.stats-toolbar {
  display: flex; flex-direction: column; align-items: stretch;
  gap: .75rem; margin-bottom: 1rem;
}
.stats-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .75rem;
  margin-bottom: 1.25rem;
}
.stats-kpis .sat-kpi { padding: .75rem .85rem; }
.stats-kpis .sat-kpi-val { font-size: 1.2rem; }
.stats-modules {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  align-items: stretch;
}
.stats-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .85rem 1rem;
  display: flex; flex-direction: column; min-width: 0;
}
.stats-block--span2 { grid-column: span 2; }
.stats-block-title {
  margin: 0 0 .65rem; font-size: .95rem; font-weight: 600; color: var(--ink);
}
.stats-rank {
  font-weight: 700; color: var(--faint); min-width: 1.35rem; display: inline-block;
}
.stats-block .followups-list {
  flex: 1;
  gap: .4rem;
}
.stats-block .followups-row {
  padding: .55rem .7rem;
}
.stats-block .followups-name { font-size: .88rem; }
.stats-block .followups-row-meta { font-size: .72rem; }
@media (max-width: 1280px) {
  .stats-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-modules { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .stats-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-modules { grid-template-columns: 1fr; }
  .stats-block--span2 { grid-column: span 1; }
}

#dash-followups .cal-dash-link { margin-top: .85rem; display: inline-block; }
#dash-followups .followups-kpis { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 720px) {
  .followups-kpis, #dash-followups .followups-kpis { grid-template-columns: 1fr; }
}

/* ── Kalender ─────────────────────────────────────────────── */
.cal-page { padding-top: .5rem; width: 100%; }
.cal-root { display: flex; flex-direction: column; gap: 1rem; width: 100%; }
.cal-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; }
.cal-nav { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.cal-nav-btn, .cal-mode-btn, .cal-today-btn {
  background: var(--surface); border: 1px solid var(--border); color: var(--mid); padding: .35rem .7rem;
  border-radius: 6px; cursor: pointer; font-size: .78rem; font-family: inherit;
}
.cal-nav-btn:hover, .cal-mode-btn:hover { background: var(--cream); }
.cal-mode-btn.is-active { background: var(--gold); color: #fff; border-color: var(--gold); }
.cal-title { font-weight: 500; font-size: .95rem; min-width: 10rem; text-align: center; color: var(--ink); }
.cal-modes { display: flex; gap: .35rem; }
.cal-emp-select select {
  padding: .35rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  font-size: .82rem; font-family: inherit; background: var(--surface); color: var(--ink);
}

.cal-day-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 48px repeat(var(--cal-cols, 4), minmax(0, 1fr));
  gap: .5rem;
}
.cal-time-axis { display: flex; flex-direction: column; padding-top: 2.2rem; }
.cal-hour-lbl { height: 48px; font-size: .68rem; color: var(--faint); text-align: right; padding-right: .35rem; }
.cal-emp-col { min-width: 0; }
.cal-emp-hdr {
  text-align: center; font-size: .78rem; font-weight: 600; padding: .45rem; color: var(--ink);
  background: var(--cream); border-radius: 8px 8px 0 0; border: 1px solid var(--border); border-bottom: none;
}
.cal-emp-body {
  position: relative; min-height: calc(var(--cal-hours, 13) * var(--cal-hour-h, 48px));
  border: 1px solid var(--border); border-radius: 0 0 8px 8px; background: var(--surface);
}

/* Kalender-Seite: verfügbare Fensterhöhe ausfüllen */
.page:has(.cal-page) {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
}
.page:has(.cal-page) .app-nav { flex-shrink: 0; }
.page:has(.cal-page) .app-hero {
  flex-shrink: 0;
  margin-bottom: .75rem;
  padding: .85rem 1rem 1rem;
}
.page:has(.cal-page) .app-main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-bottom: .75rem;
  overflow: hidden;
}
.cal-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding-top: .25rem;
}
.cal-page .cal-root {
  flex: 1;
  min-height: 0;
  gap: .65rem;
}
.cal-page .cal-toolbar { flex-shrink: 0; }
.cal-page .cal-day-grid,
.cal-page .cal-week-grid {
  flex: 1;
  min-height: 0;
}
.cal-page .cal-time-axis {
  min-height: 0;
  height: 100%;
  box-sizing: border-box;
}
.cal-page .cal-hour-lbl {
  flex: 1;
  height: auto;
  min-height: 0;
}
.cal-page .cal-emp-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.cal-page .cal-emp-hdr { flex-shrink: 0; }
.cal-page .cal-emp-body {
  flex: 1;
  min-height: 0;
}
.cal-page .cal-day-col {
  min-height: 0;
}
.cal-page .cal-day-body {
  flex: 1;
  min-height: 0;
}
.cal-appt {
  position: absolute; left: 4px; right: 4px;
  display: flex; flex-direction: row; align-items: stretch; gap: 2px;
  border-radius: 6px; overflow: hidden; z-index: 1;
  border-left: 3px solid var(--gold); background: var(--gold-bg);
}
.cal-appt-main {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: .1rem;
  padding: .3rem .45rem; border: none; background: transparent; cursor: pointer;
  text-align: left; font-family: inherit;
}
.cal-appt-wa {
  flex-shrink: 0; align-self: center; margin-right: 3px;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  background: #25D366; color: #fff; border: none; border-radius: 4px; cursor: pointer; padding: 0;
}
.cal-appt-wa:hover { background: #1ebe57; }
.cal-appt--stacked { position: static; width: 100%; margin-bottom: .35rem; min-height: auto; }
.cal-appt--block { background: var(--tint-block-bg); border-left-color: var(--tint-block-line); }
.cal-appt--break {
  background:
    repeating-linear-gradient(
      -45deg,
      var(--cream),
      var(--cream) 6px,
      color-mix(in srgb, var(--border) 55%, var(--cream)) 6px,
      color-mix(in srgb, var(--border) 55%, var(--cream)) 12px
    );
  border-left-color: var(--faint);
  border-left-style: dashed;
  opacity: .95;
}
.cal-appt--break .cal-appt-name { font-weight: 600; font-style: italic; color: var(--mid); }
.cal-appt-main--static { cursor: default; }
.cal-appt--critical { background: var(--tint-crit-bg); border-left-color: var(--tint-crit-line); }
.cal-appt--ok { background: var(--tint-ok-bg); border-left-color: var(--tint-ok-line); }
.cal-appt--pending { background: var(--tint-pend-bg); border-left-color: var(--tint-pend-line); }
.cal-appt-time { font-size: .68rem; color: var(--faint); }
.cal-appt-name {
  font-size: .78rem; font-weight: 500; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; max-width: 100%; color: var(--ink);
}
.cal-appt-treat { font-weight: 400; color: var(--mid); }
.cal-appt-hint {
  display: inline-flex; align-items: center; vertical-align: -0.05em;
  color: #c45c4a; margin-left: .22rem; line-height: 1;
}
.cal-appt-hint svg { display: block; }
.cal-appt-badge { font-size: .65rem; padding: .1rem .35rem; border-radius: 4px; }
.badge-ok { background: var(--tint-ok-bg); color: var(--tint-ok-ink); }
.badge-warn { background: var(--tint-crit-bg); color: var(--tint-crit-ink); }
.badge-pending { background: var(--tint-pend-bg); color: var(--tint-pend-ink); }

.cal-panel-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; margin-bottom: .35rem;
}
.cal-panel-wa {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem;
  padding: .35rem .65rem; white-space: nowrap;
}
.cal-link-box { margin-bottom: .25rem; }
.cal-error { color: var(--tint-crit-line); font-size: .85rem; margin: 0 0 .5rem; }

.cal-week-grid {
  display: grid;
  width: 100%;
  grid-template-columns: 48px repeat(7, minmax(0, 1fr));
  gap: .5rem;
}
.cal-day-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.cal-day-col.is-today .cal-day-hdr {
  background: color-mix(in srgb, var(--gold) 22%, var(--cream));
  color: var(--ink);
}
.cal-day-col.is-today .cal-day-body {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold);
}
.cal-day-hdr {
  text-align: center; padding: .45rem; flex-shrink: 0;
  background: var(--cream); border-radius: 8px 8px 0 0;
  border: 1px solid var(--border); border-bottom: none;
}
.cal-day-name { display: block; font-size: .68rem; color: var(--faint); text-transform: uppercase; }
.cal-day-num { font-size: 1rem; font-weight: 600; }
.cal-day-body {
  position: relative;
  flex: 1;
  min-height: calc(var(--cal-hours, 13) * var(--cal-hour-h, 48px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  background: var(--surface);
}

.cal-panel-backdrop {
  position: fixed; inset: 0; background: var(--overlay); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.cal-panel {
  background: var(--surface); color: var(--ink); border-radius: 14px; padding: 1.75rem 2rem; max-width: 440px; width: 100%;
  position: relative; box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.cal-panel-close {
  position: absolute; top: .75rem; right: .9rem; background: none; border: none;
  font-size: 1.4rem; color: var(--faint); cursor: pointer; line-height: 1;
}
.cal-panel-title { font-size: 1.2rem; font-weight: 600; margin: 0 0 .35rem; }
.cal-panel-meta, .cal-panel-services { font-size: .85rem; color: var(--mid); margin: 0 0 .5rem; }
.cal-panel-note {
  font-size: .85rem; color: var(--ink); margin: 0 0 .5rem;
  padding: .55rem .7rem; background: var(--cream); border-radius: 8px;
  border-left: 3px solid var(--gold); font-style: italic;
}
.cal-panel-survey { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--border); }
.cal-panel-survey h3 { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); margin: 0 0 .5rem; }
.cal-score { font-size: 1.1rem; font-weight: 600; }
.cal-score--low { color: var(--tint-crit-line); }
.cal-panel-comment { font-style: italic; color: var(--mid); margin: .35rem 0; }

/* Dashboard-Kalender: kompakt vs. voll (≥1400px) */
.dash-card--calendar { overflow: hidden; }
.cal-dash-compact { display: block; }
.cal-dash-full { display: none; }
.cal-dash-date { font-size: .88rem; color: var(--mid); margin: 0 0 .75rem; }
.cal-dash-mini { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .75rem; margin-bottom: .75rem; }
.cal-dash-col { font-size: .82rem; }
.cal-dash-col ul { list-style: none; margin: .25rem 0 0; padding: 0; }
.cal-dash-col li { padding: .15rem 0; color: var(--ink); }
.cal-dash-link { display: inline-block; margin-top: .25rem; text-decoration: none; }

@media (min-width: 1400px) {
  .cal-dash-compact { display: none; }
  .cal-dash-full { display: block; }
  .dash-card--calendar .cal-day-grid { --cal-cols: 4; }
}

.text-muted { color: var(--faint); font-size: .875rem; font-style: italic; }

/* ── Mobil: Überlauf vermeiden ───────────────────────────── */
@media (max-width: 640px) {
  .sat-kpis { grid-template-columns: 1fr; }
  .link-box-row { flex-direction: column; align-items: stretch; }
  .link-box-actions { flex-direction: column; align-items: stretch; }
  .link-box-actions .btn-gold-sm,
  .link-box-actions .btn-whatsapp { width: 100%; justify-content: center; }
  .cal-panel {
    margin: .5rem;
    padding: 1.25rem 1.25rem;
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
  }
}

/* ── Kalender: Desktop-Gitter vs. Mobile-Agenda ──────────── */
.cal-mobile-only { display: none; }
.cal-desktop-only { display: contents; }

.cal-agenda-wrap { display: flex; flex-direction: column; gap: .85rem; flex: 1; min-height: 0; }
.cal-emp-pills, .cal-day-pills {
  display: flex; gap: .4rem; overflow-x: auto; -webkit-overflow-scrolling: touch;
  padding-bottom: .15rem; scrollbar-width: thin;
}
.cal-emp-pill, .cal-day-pill {
  flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); color: var(--ink);
  border-radius: 8px; padding: .45rem .7rem; font-family: inherit; font-size: .8rem;
  cursor: pointer; display: flex; align-items: center; gap: .35rem;
}
.cal-emp-pill.is-active, .cal-day-pill.is-active {
  background: var(--gold); color: #fff; border-color: var(--gold);
}
.cal-day-pill {
  flex-direction: column; align-items: center; min-width: 3.1rem; padding: .4rem .45rem; gap: .1rem;
}
.cal-day-pill.is-today:not(.is-active) { border-color: var(--gold); }
.cal-day-pill-name { font-size: .62rem; text-transform: uppercase; color: inherit; opacity: .75; }
.cal-day-pill-num { font-size: 1rem; font-weight: 600; line-height: 1.1; }
.cal-emp-pill-count, .cal-day-pill-count {
  font-size: .65rem; font-weight: 600; opacity: .8;
  background: color-mix(in srgb, currentColor 16%, transparent);
  border-radius: 999px; padding: .05rem .35rem; min-width: 1.1rem; text-align: center;
}
.cal-agenda-day-label { margin: 0; font-size: .88rem; color: var(--mid); font-weight: 500; }
.cal-agenda-empty { margin: .5rem 0 0; }
.cal-agenda { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.cal-agenda-item {
  display: flex; align-items: stretch; gap: .35rem;
  background: var(--cream); border: 1px solid var(--border); border-radius: 10px;
  border-left: 3px solid var(--gold); overflow: hidden;
}
.cal-agenda-item.cal-appt--critical { border-left-color: var(--tint-crit-line); background: var(--tint-crit-bg); }
.cal-agenda-item.cal-appt--ok { border-left-color: var(--tint-ok-line); background: var(--tint-ok-bg); }
.cal-agenda-item.cal-appt--pending { border-left-color: var(--tint-pend-line); background: var(--tint-pend-bg); }
.cal-agenda-item--break {
  border-left-color: var(--tint-block-line);
  background: repeating-linear-gradient(
    -45deg,
    var(--cream),
    var(--cream) 6px,
    color-mix(in srgb, var(--border) 55%, transparent) 6px,
    color-mix(in srgb, var(--border) 55%, transparent) 12px
  );
}
.cal-agenda-main {
  flex: 1; min-width: 0; text-align: left; border: 0; background: transparent;
  padding: .7rem .85rem; font-family: inherit; color: var(--ink); cursor: pointer;
  display: flex; flex-direction: column; gap: .15rem;
}
.cal-agenda-item--break .cal-agenda-main { cursor: default; }
.cal-agenda-time { font-size: .72rem; color: var(--faint); font-weight: 600; }
.cal-agenda-name { font-size: .95rem; font-weight: 600; line-height: 1.25; word-break: break-word; }
.cal-agenda-treat { font-size: .8rem; color: var(--mid); }
.cal-agenda-wa {
  flex: 0 0 auto; align-self: center; margin-right: .55rem;
  width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 0;
  background: #25d366; color: #fff; display: grid; place-items: center; cursor: pointer;
}
.cal-agenda-wa:hover { background: #1ebe57; }

@media (max-width: 900px) {
  .cal-page .cal-desktop-only { display: none !important; }
  .cal-page .cal-mobile-only { display: flex; }
  .cal-page .cal-toolbar { gap: .55rem; }
  .cal-page .cal-title { min-width: 0; font-size: .88rem; }
  .cal-page .app-hero,
  .page:has(.cal-page) .app-hero {
    padding-top: .85rem; padding-bottom: .85rem;
  }
  .cal-page .cal-appt-wa { display: none; }
}

@media (min-width: 901px) {
  .cal-mobile-only { display: none !important; }
  .cal-desktop-only { display: contents; }
}
