/* ============================================
   Design-Tokens — make you RISE
   Premium, dunkel, roségold. Aus dem Brand Kit übernommen:
   Roségold #D4AF91, Tiefschwarz #121212, Soft-Beige #F4EFEA, Reinweiß #FFFFFF.
   ============================================ */
:root {
  --cream: #F4EFEA;
  --cream-deep: #EAE1D5;
  --ink: #121212;
  --ink-soft: #6E665D;
  --forest: #D4AF91;
  --forest-deep: #B8916F;
  --ochre: #D4AF91;
  --ochre-soft: #EDE0D3;
  --coral: #A8402E;
  --line: #E3D9CC;
  --white: #FFFFFF;

  --font-display: "Playfair Display", Georgia, serif;
  --font-script: "Parisienne", cursive;
  --font-body: "Montserrat", -apple-system, sans-serif;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(18, 18, 18, 0.08), 0 4px 16px rgba(18, 18, 18, 0.06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 14.5px;
  line-height: 1.5;
}

.hidden { display: none !important; }
.muted { color: var(--ink-soft); }
code {
  background: var(--cream-deep);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
}

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 14px 20px;
  background: var(--ink);
  border-bottom: 1px solid #262626;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  border-radius: 50%;
  overflow: hidden;
}
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text h1 {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  line-height: 1.1;
  color: var(--white);
  letter-spacing: 0.02em;
}
.brand-script {
  font-family: var(--font-script);
  font-weight: 400;
  color: var(--forest);
  font-size: 1.2em;
  margin-right: 8px;
  display: inline-block;
}
.brand-tag { margin: 2px 0 0; font-size: 12px; color: #B5AB9D; }

.topnav { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.nav-btn {
  border: none;
  background: transparent;
  padding: 8px 14px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 500;
  color: #CFC6BA;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-btn:hover { background: rgba(212, 175, 145, 0.16); color: var(--white); }
.nav-btn.active { background: var(--forest); color: var(--ink); }

.btn-primary {
  background: var(--forest);
  color: var(--ink);
  border: none;
  padding: 9px 18px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: var(--forest-deep); }
.btn-primary:active { transform: scale(0.98); }

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  padding: 9px 18px;
  border-radius: 20px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 13.5px;
  color: var(--ink-soft);
  cursor: pointer;
}
.btn-ghost:hover { background: var(--cream-deep); }

.icon-btn {
  background: transparent;
  border: none;
  font-size: 18px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  padding: 4px;
}
.icon-btn:hover { color: var(--forest-deep); }
.topbar .icon-btn { color: #CFC6BA; }
.topbar .icon-btn:hover { color: var(--forest); }

/* ---------- Layout ---------- */
main { padding: 24px 28px 60px; max-width: 1400px; margin: 0 auto; }

.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.stat-card .num {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 600;
  color: var(--forest-deep);
}
.stat-card .label {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

/* ---------- Board ---------- */
.board {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
}

.column {
  background: var(--cream-deep);
  border-radius: 12px;
  min-width: 260px;
  max-width: 280px;
  flex-shrink: 0;
  padding: 12px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
}

.column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 12px;
}
.column-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
}
.column-count {
  background: var(--white);
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 10px;
  padding: 2px 8px;
}

.column-cards {
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}
.column-cards.drag-over { background: var(--ochre-soft); border-radius: 8px; }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  cursor: grab;
  box-shadow: var(--shadow);
  transition: transform 0.1s;
}
.card:active { cursor: grabbing; }
.card.dragging { opacity: 0.4; }

.card-name { font-weight: 600; font-size: 13.5px; }
.card-meta {
  font-size: 11.5px;
  color: var(--ink-soft);
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.card-campaign {
  font-size: 10.5px;
  color: var(--ink-soft);
  margin-top: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tag {
  background: var(--ochre-soft);
  color: #7A5540;
  padding: 1px 7px;
  border-radius: 8px;
  font-size: 10.5px;
  font-weight: 600;
}

.column-empty {
  color: var(--ink-soft);
  font-size: 12px;
  text-align: center;
  padding: 18px 6px;
  font-style: italic;
}

/* ---------- List view ---------- */
.list-controls { margin-bottom: 14px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
#listSearch {
  width: 100%;
  max-width: 380px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13.5px;
  background: var(--white);
}
#listNetworkFilter { max-width: 220px; }
#columnPickerMenu { min-width: 210px; }
.column-picker-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: 13px;
  color: var(--ink);
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.column-picker-item:hover { background: var(--cream-deep); }
.column-picker-item input { width: auto; margin: 0; }
.sortable-th { cursor: pointer; user-select: none; }
.sortable-th:hover { color: var(--ink); }
.bulk-delete-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.contact-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.contact-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.contact-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.contact-table tr:last-child td { border-bottom: none; }
.contact-table tr:hover { background: var(--cream); }

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.status-Neu { background: var(--ochre-soft); color: #7A5540; }
.status-Kontaktiert { background: #E7DFD3; color: var(--forest-deep); }
.status-Interessiert { background: #F0DFCF; color: var(--forest-deep); }
.status-Kunde { background: var(--forest); color: var(--ink); }
.status-Kein-Interesse { background: #F2DAD4; color: var(--coral); }
.status-Businesspartner { background: var(--ink); color: var(--forest); }

/* ---------- Import ---------- */
.import-layout { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.import-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 680px;
  box-shadow: var(--shadow);
}
.import-layout .import-card { flex: 1 1 620px; }
.import-sheet-card { flex: 2 1 560px; max-width: none; min-width: 0; }
.import-card h2 { font-family: var(--font-display); margin-top: 0; }

.sheet-scroll { overflow: auto; max-height: 70vh; border: 1px solid var(--line); border-radius: 8px; }
.sheet-table { border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.sheet-table th, .sheet-table td {
  border: 1px solid var(--line);
  padding: 5px 9px;
  text-align: left;
}
.sheet-table thead th {
  position: sticky;
  top: 0;
  background: var(--cream-deep);
  font-weight: 700;
  color: var(--ink-soft);
  z-index: 1;
}
.sheet-table .sheet-rownum {
  position: sticky;
  left: 0;
  background: var(--cream-deep);
  color: var(--ink-soft);
  text-align: center;
  font-weight: 600;
  z-index: 1;
}
.sheet-table thead .sheet-rownum { z-index: 2; }
.sheet-table tbody tr:nth-child(even) td { background: var(--cream); }
#importForm { display: flex; flex-direction: column; gap: 14px; margin-top: 16px; }
#csvFile {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 16px;
  font-family: var(--font-body);
  font-size: 13px;
}
.import-result {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: var(--cream-deep);
  font-size: 13px;
}

/* ---------- Modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(18, 18, 18, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-card {
  background: var(--white);
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: 0 12px 40px rgba(0,0,0,0.18);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.modal-head h2 { font-family: var(--font-display); margin: 0; font-size: 19px; flex: 1 1 auto; }
.whatsapp-cta-btn { text-decoration: none; white-space: nowrap; background: #25D366; color: #fff; }
.whatsapp-cta-btn:hover { background: #1EBE5A; }
.btn-ghost.recording {
  color: #fff;
  background: var(--coral);
  border-color: var(--coral);
  animation: recording-pulse 1.2s ease-in-out infinite;
}
@keyframes recording-pulse { 50% { opacity: 0.65; } }
.sms-cta-btn { text-decoration: none; white-space: nowrap; background: var(--forest-deep); color: #fff; }
.sms-cta-btn:hover { background: #96754F; }

/* flex-wrap + flex-basis statt starrem 2-Spalten-Zwang: Felder brechen von selbst
   auf jeder Bildschirmbreite um, sobald sie nicht mehr nebeneinander passen -
   robuster als ein fester Media-Query-Umbruchpunkt. */
.form-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.form-row label { flex: 1 1 200px; min-width: 0; }
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 4px;
}
label.full { margin-bottom: 12px; }
input, select, textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font-family: var(--font-body);
  font-size: 13.5px;
  color: var(--ink);
  background: var(--cream);
}
/* iOS Safari lässt Datumsfelder sonst gern über den Rand hinausragen, da das
   eingebaute Kalender-Widget eine eigene Mindestbreite mitbringt. */
input[type="date"], input[type="datetime-local"] {
  min-width: 0;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}
textarea { resize: vertical; }

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

.detail-row { margin-bottom: 10px; font-size: 13.5px; }
.detail-label { font-size: 11px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.detail-notes {
  white-space: pre-wrap;
  background: var(--cream);
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 4px;
  font-size: 13px;
}

/* ---------- Lead-Fenster (Kontakt-Detail) ---------- */
#cardModal .modal-card { max-width: min(620px, 100%); }

.optin-box {
  background: var(--ochre-soft);
  border-radius: 10px;
  padding: 12px 14px 2px;
  margin-bottom: 12px;
}
.optin-box label { color: #7A5540; }
.optin-box select, .optin-box input {
  background: var(--white);
}

.screening-box {
  background: var(--cream-deep);
  border-radius: 10px;
  padding: 4px 14px 12px;
  margin-bottom: 12px;
}
.screening-box summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 13.5px;
  padding: 10px 0;
  color: var(--forest-deep);
}
.screening-box[open] summary { margin-bottom: 8px; }
.screening-box label { margin-top: 10px; }

.dynamic-fields-box {
  background: var(--cream-deep);
  border-radius: 10px;
  padding: 12px 14px 2px;
  margin-bottom: 12px;
}

.activity-section {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.activity-section h3 {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 12px;
}
.activity-quick-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.activity-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}
.activity-form-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.activity-form select {
  width: auto;
  flex-shrink: 0;
  max-width: 110px;
}
.activity-form input[type="datetime-local"] {
  width: auto;
  flex-shrink: 0;
  max-width: 185px;
}
.activity-form textarea {
  width: 100%;
  resize: vertical;
}
.activity-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
}
.activity-item {
  background: var(--cream);
  border-radius: 8px;
  padding: 10px 12px;
}
.activity-item.type-question {
  background: var(--ochre-soft);
}
.activity-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 4px;
}
.activity-type { font-weight: 700; color: var(--forest-deep); }
.activity-content { font-size: 13px; white-space: pre-wrap; }

/* ---------- Login ---------- */
.login-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cream);
}
.login-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 30px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-card .brand-mark { margin: 0 auto 14px; }
.login-card h1 {
  font-family: var(--font-display);
  font-size: 21px;
  margin: 0 0 2px;
}
.login-card .brand-tag { margin-bottom: 22px; color: var(--ink-soft); }
.login-card label {
  text-align: left;
  margin-bottom: 12px;
  display: block;
}
.login-error {
  background: #F2DAD4;
  color: var(--coral);
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 7px;
  margin-bottom: 12px;
  text-align: left;
}
.login-divider {
  width: 100%;
  max-width: 360px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 12.5px;
  margin: 16px 0;
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}
.google-login-btn {
  display: flex;
  justify-content: center;
  width: 100%;
  max-width: 360px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 8px;
}
.user-name { font-size: 12.5px; color: #CFC6BA; font-weight: 500; }
.user-name-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  padding: 4px 8px;
  border-radius: 12px;
}
.user-name-btn:hover { background: rgba(212, 175, 145, 0.16); }

.org-switcher {
  background: rgba(212, 175, 145, 0.12);
  color: #CFC6BA;
  border: 1px solid rgba(212, 175, 145, 0.35);
  border-radius: 8px;
  padding: 5px 8px;
  font-family: var(--font-body);
  font-size: 12px;
  cursor: pointer;
}
.org-switcher:hover { background: rgba(212, 175, 145, 0.2); }
.org-switcher option { color: #1a1a1a; }

/* ---------- Einstellungen-Dropdown ---------- */
.nav-dropdown { position: relative; }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
  padding: 6px;
  display: flex;
  flex-direction: column;
  min-width: 160px;
  z-index: 50;
}
.nav-dropdown-menu .nav-btn { text-align: left; border-radius: 8px; color: var(--ink-soft); }
.nav-dropdown-menu .nav-btn:hover { background: var(--cream-deep); color: var(--ink); }
.nav-dropdown-menu .nav-btn.active { background: var(--forest); color: var(--ink); }

/* ---------- Kanban-Spalten verschieben ---------- */
.column.dragging-col { opacity: 0.4; }

/* ---------- Google view ---------- */
.google-btn-row { display: flex; gap: 10px; }
.status-connected { color: var(--forest-deep); font-weight: 600; }
.status-disconnected { color: var(--ink-soft); }

/* ---------- Team view ---------- */
.role-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--ochre-soft);
  color: #7A5540;
}
.role-badge.admin { background: var(--forest); color: var(--ink); }

.team-list { display: flex; flex-direction: column; gap: 14px; margin: 16px 0 8px; }
.team-user-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  background: var(--cream);
}
.team-user-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 10px;
}
.team-user-head strong { font-size: 16px; margin-right: 10px; }
.team-user-email { color: var(--ink-soft); font-size: 13px; }
.permission-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 12px 0 8px;
}
.permission-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px 18px;
}
.permissions-note { font-size: 12.5px; color: var(--ink-soft); font-style: italic; }
.permission-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}
.permission-toggle input { width: auto; margin: 0; }
.team-user-actions {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
}

/* ---------- Famulor-Karte ---------- */
.famulor-info code {
  background: var(--cream-deep);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
.copy-row { display: flex; gap: 8px; align-items: center; margin-top: 4px; }
.copy-row input { flex: 1 1 auto; font-family: monospace; font-size: 12.5px; }
.copy-row .btn-ghost { flex: 0 0 auto; white-space: nowrap; }

.opt-out-flag { font-size: 13px; }
.opt-out-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--coral);
  background: color-mix(in srgb, var(--coral) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--coral) 35%, transparent);
  border-radius: 8px;
  padding: 9px 12px;
  margin: 4px 0 14px;
  cursor: pointer;
}
.opt-out-toggle input { width: auto; margin: 0; }
.invalid-marker { cursor: help; font-size: 12px; }
.link-danger {
  background: none;
  border: none;
  color: var(--coral);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.link-edit {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.activity-actions { margin-top: 6px; display: flex; gap: 14px; }

/* ---------- Rufnummern-Prüfung ---------- */
.phone-check-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 14px;
}
.phone-check-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13.5px;
}
.phone-check-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.phone-old { color: var(--coral); font-family: monospace; }
.phone-arrow { color: var(--ink-soft); }
.phone-new { color: var(--forest-deep); font-weight: 600; font-family: monospace; }
.phone-manual-input { flex: 1 1 200px; max-width: 260px; font-family: monospace; }

/* ---------- Felder verwalten ---------- */
.field-admin-item {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
}
.field-admin-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13.5px;
}
.field-admin-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.add-option-form {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.add-option-form input {
  flex: 1;
  padding: 6px 10px;
  font-size: 12.5px;
}
.add-option-form button {
  padding: 6px 12px;
  font-size: 13px;
}

/* ---------- Board-Tabs ---------- */
.board-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.board-tab {
  border: 1px solid var(--line);
  background: var(--white);
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
}
.board-tab.active {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--ink);
}
.board-tab-wrap { display: inline-flex; }
.board-tab-wrap[draggable="true"] { cursor: grab; }
.board-tab-wrap[draggable="true"] .board-tab { cursor: grab; }
.board-tab-wrap.dragging-col { opacity: 0.4; }
.board-tab-add {
  border: 1px dashed var(--line);
  background: transparent;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
}
.board-tab-add:hover { background: var(--cream-deep); }

/* ---------- Editierbare Spalten ---------- */
.column-title-input {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  border: none;
  background: transparent;
  padding: 2px 4px;
  width: 100%;
  color: var(--ink);
}
.column-title-input:focus {
  outline: none;
  background: var(--white);
  border-radius: 4px;
}
.column-delete-btn {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  opacity: 0.5;
}
.column-delete-btn:hover { opacity: 1; color: var(--coral); }

.add-column {
  min-width: 220px;
  flex-shrink: 0;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  padding: 12px;
  align-self: flex-start;
}
.add-column:hover { background: var(--cream-deep); }

.column-title { cursor: pointer; }
.column-title:hover { text-decoration: underline dotted; }

.column-delete {
  background: none;
  border: none;
  color: var(--ink-soft);
  font-size: 12px;
  cursor: pointer;
  padding: 0 2px;
  opacity: 0.5;
}
.column-delete:hover { opacity: 1; color: var(--coral); }

.column-add {
  min-width: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  padding-top: 4px;
}
.column-add-btn {
  border: 1px dashed var(--line);
  background: transparent;
  border-radius: 10px;
  color: var(--ink-soft);
  font-size: 13px;
  cursor: pointer;
  padding: 12px 16px;
  width: 100%;
}
.column-add-btn:hover { background: var(--cream-deep); }

.board-tab-icon {
  border: 1px solid var(--line);
  background: var(--white);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 13px;
  cursor: pointer;
  color: var(--ink-soft);
}
.board-tab-icon:hover { background: var(--cream-deep); }

.board-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

/* ---------- Responsive ---------- */
/* .topbar/.topnav/.form-row/.stats-row sind bereits fluid (flex-wrap bzw. grid
   auto-fit) und passen sich ohne Media-Query jeder Breite an. Hier nur noch
   Feinschliff für sehr schmale Bildschirme (Smartphones). */
@media (max-width: 720px) {
  main { padding: 16px 14px 40px; }
  .topbar { padding: 12px 14px; }
  .topnav { order: 3; width: 100%; justify-content: flex-start; }
  .brand-text h1 { font-size: 17px; }
  .contact-table { font-size: 12px; }
  .contact-table th, .contact-table td { padding: 10px; white-space: nowrap; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-card {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
    padding: 18px;
  }
  .board { gap: 10px; }
  .column { min-width: 220px; max-width: 240px; }
  .nav-dropdown-menu { right: -14px; }
}

@media (max-width: 420px) {
  .form-row label { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Drag & Drop-Zone fuer den Lead-Import (Datei vom PC direkt reinziehen) */
.import-dropzone {
  position: relative;
  border: 2px dashed var(--forest-deep);
  border-radius: 10px;
  padding: 22px 16px;
  text-align: center;
  transition: border-color .15s ease, background .15s ease;
}
.import-dropzone.import-dropzone-active {
  border-color: var(--forest-deep);
  background: var(--ochre-soft);
}
.import-dropzone input[type="file"] {
  display: block;
  margin: 0 auto;
}
.import-dropzone-hint {
  margin: 10px 0 0;
  font-size: 12.5px;
  color: var(--ink-soft);
}

.tag-editable {
  cursor: pointer;
}
.tag-editable:hover {
  background: var(--forest-deep);
  color: var(--white);
}

.column-status-select {
  width: 100%;
  margin: -6px 0 8px;
  padding: 3px 6px;
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  color: var(--ink-soft);
}

.tag-chip-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--white);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.tag-removable {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.tag-removable button {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 10px;
  padding: 0;
  line-height: 1;
}
/* ============================================
   Kalender-Ansicht (Termin-Übersicht)
   ============================================ */
.calendar-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
.calendar-controls h2 {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--ink);
  min-width: 200px;
  text-align: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.calendar-weekday {
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 4px 0;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.calendar-day {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 96px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.calendar-day.calendar-day-outside {
  background: var(--cream);
  opacity: 0.55;
}
.calendar-day.calendar-day-today {
  border-color: var(--forest-deep);
  box-shadow: 0 0 0 1px var(--forest-deep);
}
.calendar-day-number {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
}
.calendar-appointment {
  background: var(--ochre-soft);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 11.5px;
  line-height: 1.3;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.calendar-appointment:hover { background: var(--forest); }
.calendar-appointment-time { font-weight: 600; margin-right: 4px; }

/* ============================================
   Anruf-/WhatsApp-Icons neben Telefonnummern
   ============================================ */
.phone-actions { display: inline-flex; gap: 4px; margin-left: 6px; vertical-align: middle; }
.phone-action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ochre-soft);
  text-decoration: none;
  font-size: 11.5px;
  line-height: 1;
  cursor: pointer;
}
.phone-action-icon:hover { background: var(--forest); }

/* WhatsApp-Logo / Brief-Symbol (inline SVG, siehe ICON_WHATSAPP/ICON_SMS in app.js) */
.ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex-shrink: 0; }
.phone-action-icon .ico { width: 13px; height: 13px; vertical-align: 0; }
.phone-action-icon .ico-wa, .btn-ghost .ico-wa { color: #1FA855; }
.phone-action-icon .ico-sms, .btn-ghost .ico-sms { color: #7A5540; }
.btn-ghost .ico { margin-right: 2px; }
/* WhatsApp-Logo + Schreib-Hand ("WhatsApp vorbereiten") nebeneinander */
.ico-wa-hand { display: inline-flex; align-items: center; gap: 2px; }
.ico-wa-hand .hand { font-size: 12px; line-height: 1; }
.phone-action-icon.phone-action-wide { width: auto; padding: 0 6px; border-radius: 11px; }
.phone-action-icon .ico-wa-hand .ico { color: #1FA855; }
.whatsapp-cta-btn .ico-wa-hand { margin-right: 6px; }

.tag-chip-add {
  border: none;
  outline: none;
  flex: 1;
  min-width: 120px;
  font-size: 13px;
  padding: 2px;
  background: transparent;
}

/* Kontaktliste: Seitenumschaltung */
.list-pager { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0; font-size: 13px; }
.list-pager select { padding: 4px 8px; }
.list-pager button[disabled] { opacity: 0.4; cursor: default; }

/* ============================================
   EQology (Abo + Bluttests)
   ============================================ */
.eq-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}
.eq-badge-kunde { background: #CDE8CF; color: #2C5E33; }          /* Kunde */
.eq-badge-businesspartner { background: #DCD2F0; color: #46367A; } /* Businesspartner */
.eq-badge-t-aufgegeben { background: #F6E7A8; color: #6B5A10; }    /* gelb: Test aufgegeben */
.eq-badge-t-online { background: #CDE8CF; color: #2C5E33; }        /* gruen: Test online */
.eq-badge-t-besprochen { background: var(--cream-deep); color: var(--ink-soft); } /* Besprechung gemacht */
.eq-badge-due { background: #F5C9A0; color: #7A3E0C; }         /* orange: diesen Monat faellig */

.eq-due-filter { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin: 0; }
.eq-due-filter input { width: auto; margin: 0; }
.eq-check { display: flex; align-items: center; gap: 8px; align-self: end; }
.eq-check input { width: auto; margin: 0; }
.eq-org-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin-left: 14px; }
.eq-org-toggle input { width: auto; margin: 0; }

.eq-test-block { margin-top: 16px; padding-top: 10px; border-top: 1px solid var(--line); }
.eq-test-block h4 { margin: 0 0 8px; font-family: var(--font-display); font-size: 14px; }
.eq-test-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.eq-test-table th { text-align: left; font-weight: 600; font-size: 11px; color: var(--ink-soft); padding: 0 6px 4px 0; white-space: nowrap; }
.eq-test-table td { padding: 3px 6px 3px 0; vertical-align: middle; }
.eq-test-table td:first-child { white-space: nowrap; color: var(--ink-soft); }
.eq-test-table input { width: 100%; min-width: 70px; padding: 5px 7px; font-size: 12.5px; }
.eq-del { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 13px; padding: 2px 4px; }
.eq-del:hover { color: var(--coral); }
.eq-add { margin-top: 8px; padding: 5px 12px; font-size: 12px; }
.eq-due { margin-top: 6px; font-size: 12px; color: var(--ink-soft); }
.eq-due-now { color: #7A3E0C; background: #F5C9A0; display: inline-block; padding: 3px 9px; border-radius: 8px; font-weight: 600; }
.eq-actions { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
#eqBoxBody { overflow-x: visible; }
.eq-table-wrap { overflow-x: auto; }
.eq-test-table td:nth-child(2) input { min-width: 125px; }  /* Testnummern wie EQ5M39SPARS2C */
.eq-test-table td:nth-child(3) input { min-width: 125px; }  /* Datum */

/* EQology: Produktauswahl (gewaehlte Produkte als Chips, Katalog zum Aufklappen) */
.eq-products { margin-top: 10px; }
.eq-products-head { display: flex; align-items: center; gap: 10px; }
.eq-products-title { font-size: 12px; font-weight: 600; color: var(--ink-soft); }
.eq-products-head .eq-add { margin-top: 0; }
.eq-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.eq-chip { background: var(--ochre-soft); color: #7A5540; border-radius: 12px; padding: 3px 10px; font-size: 12.5px; font-weight: 600; }
.eq-chip-x { background: none; border: none; cursor: pointer; color: inherit; font-size: 11px; padding: 0 0 0 4px; }
.eq-chip-x:hover { color: var(--coral); }
.eq-prod-panel { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.eq-prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 14px; }
.screening-box .eq-prod-opt { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--ink); margin: 0; }
.eq-prod-opt input { width: auto; margin: 0; }

/* EQology: Test-Status je Test (Auswahl + Hinweis zu den 21 Werktagen) */
.eq-status-cell select { width: 100%; min-width: 165px; padding: 5px 7px; font-size: 12.5px; }
.eq-hint-slot { margin-top: 2px; }
.eq-hint { font-size: 11px; color: var(--ink-soft); }
.eq-hint-online { color: #2C5E33; font-weight: 600; }
.eq-hint-done { color: var(--ink-soft); font-weight: 600; }
.eq-hint-late { color: #7A3E0C; background: #F5C9A0; padding: 1px 6px; border-radius: 6px; font-weight: 600; }

/* EQology-Erinnerung im CRM-Kalender (Ganztags-Eintrag) */
.calendar-eq { background: #B8892F; }
.calendar-eq:hover { background: #8F6A1F; }

.contact-table .eq-hint-late { display: inline-block; }
.contact-table td .eq-badge { margin-left: 2px; }

/* ---------- Handy (<= 720px): Tab-Leiste unten, kompakte Kopfzeile, Board zum Wischen ---------- */
.nav-short { display: none; }
.card-move, .board-col-jump { display: none; }

@media (max-width: 720px) {
  main { padding: 12px 12px calc(96px + env(safe-area-inset-bottom)); }

  /* Kopfzeile: Logo | Organisation | Name | Abmelden */
  .topbar { flex-wrap: nowrap; gap: 10px; padding: 8px 12px; overflow: hidden; }
  .brand-tag, .brand-text { display: none; }
  .brand-mark { width: 34px; height: 34px; }
  .user-menu { flex: 1; min-width: 0; margin-left: 0; gap: 6px; justify-content: flex-end; }
  /* width:0 + flex:1 -> iOS-Safari laesst das Auswahlfeld sonst nicht schrumpfen und die Seite wird breiter als der Bildschirm */
  .org-switcher { flex: 1 1 0; width: 0; min-width: 0; max-width: none; font-size: 14px; padding: 7px 8px; text-overflow: ellipsis; }
  .user-name-btn { flex: 0 0 auto; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; padding: 6px; }
  .icon-btn { padding: 8px; flex: 0 0 auto; }
  /* Nie breiter als der Bildschirm: sonst vergroessert iOS die Seitenbreite und alles wirkt rechts abgeschnitten */
  html, body { max-width: 100%; overflow-x: clip; }

  /* Hauptnavigation als feste Leiste unten (Daumen-Reichweite) */
  .topnav {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40;
    order: 0; width: 100%; margin: 0; gap: 0; flex-wrap: nowrap; justify-content: space-around;
    background: var(--ink); border-top: 1px solid #262626;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    overflow-x: auto;
  }
  .topnav > .nav-btn, .topnav .nav-dropdown > .nav-btn {
    flex: 1 1 0; min-width: 0; padding: 10px 2px; font-size: 11px; border-radius: 12px;
    text-align: center; white-space: nowrap;
  }
  .nav-dropdown { flex: 1 1 0; min-width: 0; display: flex; }
  .nav-dropdown > .nav-btn { width: 100%; }
  .nav-long { display: none; }
  .nav-short { display: inline; }
  .stats-row, .board, .board-tabs, .topnav { scrollbar-width: none; }
  .stats-row::-webkit-scrollbar, .board::-webkit-scrollbar, .board-tabs::-webkit-scrollbar, .topnav::-webkit-scrollbar { display: none; }
  .nav-dropdown-menu {
    position: fixed; left: 8px; right: 8px; top: auto;
    bottom: calc(62px + env(safe-area-inset-bottom)); min-width: 0; padding: 8px;
  }
  .nav-dropdown-menu .nav-btn { padding: 14px 12px; font-size: 15px; }

  /* "+ Neuer Kontakt" als runder Button schwebend ueber der Leiste */
  #newContactBtn {
    position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 41;
    width: 54px; height: 54px; border-radius: 50%; padding: 0; font-size: 0;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
  }
  #newContactBtn::before { content: '+'; font-size: 30px; line-height: 54px; font-weight: 500; }

  /* Kennzahlen als kompakte Wischleiste statt 2x2-Raster */
  .stats-row { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 12px; padding-bottom: 2px; }
  .stat-card { flex: 0 0 auto; min-width: 104px; padding: 8px 12px; }
  .stat-card .num { font-size: 20px; }

  /* Board: eine Spalte pro Bildschirm, Wischen mit Einrasten; Spaltensprung oben */
  .board-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .board-tabs > * { flex: 0 0 auto; }
  .board-tab, .board-tab-add, .board-tab-icon { white-space: nowrap; }
  .board-col-jump {
    display: block; width: 100%; margin: 0 0 10px; padding: 11px 12px; font-size: 16px;
    border: 1px solid var(--line); border-radius: 10px; background: var(--white);
  }
  .board { scroll-snap-type: x mandatory; scroll-padding-left: 12px; margin: 0 -12px; padding: 0 12px 12px; gap: 10px; }
  .column {
    min-width: calc(100vw - 40px); max-width: calc(100vw - 40px); scroll-snap-align: start;
    max-height: calc(100dvh - 300px);
  }
  .column-add { min-width: calc(100vw - 40px); }
  .card { cursor: pointer; padding: 12px; }
  .card-name { font-size: 15px; }
  .card-meta { font-size: 13px; }
  .card-move {
    display: block; width: 100%; margin-top: 10px; padding: 9px 10px; font-size: 16px;
    border: 1px solid var(--line); border-radius: 8px; background: var(--cream-deep); color: var(--ink-soft);
  }
}

/* ---------- Handy Teil B: Listen als Karten, Formulare, Kalender ---------- */
@media (max-width: 720px) {
  /* Eingabefelder mind. 16px, sonst zoomt iOS beim Antippen hinein */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px !important; }
  button, .btn-primary, .btn-ghost { min-height: 40px; }

  /* Filterzeile: alles untereinander, volle Breite */
  .list-controls { gap: 8px; }
  .list-controls > *, #listSearch { width: 100%; max-width: none; }
  .list-controls select, .list-controls .btn-ghost { width: 100%; }
  .list-controls .nav-dropdown { width: 100%; }
  .list-controls .nav-dropdown > .btn-ghost { width: 100%; }
  .list-pager { gap: 6px; font-size: 12.5px; }

  /* Tabellen -> Karten (Kontaktliste, EQology-Uebersicht) */
  .table-scroll { overflow: visible; }
  .contact-table, .contact-table tbody { display: block; background: transparent; box-shadow: none; overflow: visible; }
  .contact-table thead { display: none; }
  .contact-table tr {
    display: block; position: relative; background: var(--white); border: 1px solid var(--line);
    border-radius: 12px; padding: 12px 14px 8px; margin-bottom: 10px; box-shadow: var(--shadow);
  }
  .contact-table tr:hover { background: var(--white); }
  .contact-table td {
    display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
    padding: 5px 0; border: none; font-size: 14px; white-space: normal !important; text-align: right;
  }
  .contact-table td::before {
    content: attr(data-label); flex: 0 0 34%; text-align: left; font-size: 11px; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-soft);
  }
  .contact-table td.td-empty { display: none; }
  .contact-table td[data-label="Kontakt"] { display: block; text-align: left; }
  .contact-table td[data-label="Kontakt"]::before { display: block; margin-bottom: 3px; }
  #listPagerTop { display: none; }
  .list-page-first, .list-page-last { display: none; }
  .contact-table td.td-title { display: block; text-align: left; font-size: 17px; font-weight: 600; padding: 0 36px 6px 0; }
  .contact-table td.td-title::before, .contact-table td.td-check::before { display: none; }
  .contact-table td.td-check { position: absolute; top: 12px; right: 12px; padding: 0; display: block; }
  .contact-table td.td-check input { width: 22px; height: 22px; }

  /* Kontakt-Fenster: Speichern-Leiste bleibt unten sichtbar */
  .modal-actions {
    position: sticky; bottom: -18px; background: var(--white); padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); margin-top: 12px; z-index: 3;
  }
  .modal-actions .btn-primary { flex: 1; }
  #cardModal .modal-card { max-height: 94vh; }

  /* EQology-Formular: Testzeilen gestapelt statt breiter Tabelle */
  .eq-table-wrap { overflow: visible; }
  .eq-test-table, .eq-test-table tbody { display: block; }
  .eq-test-table thead { display: none; }
  .eq-test-table tr {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; position: relative;
    border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--white);
  }
  .eq-test-table td { display: block; padding: 0; min-width: 0; }
  .eq-test-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; }
  .eq-test-table td.eq-round { grid-column: 1 / -1; font-weight: 700; color: var(--ink); padding-right: 36px; }
  .eq-test-table td.eq-round::before { display: none; }
  .eq-test-table td.eq-status-cell { grid-column: 1 / -1; }
  .eq-test-table td.eq-del-cell { position: absolute; top: 6px; right: 8px; }
  .eq-test-table td.eq-del-cell::before { display: none; }
  .eq-test-table input, .eq-status-cell select { width: 100%; min-width: 0 !important; padding: 9px 10px; }
  .eq-actions {
    position: sticky; bottom: -18px; background: var(--white); padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line); z-index: 3;
  }
  .eq-actions .btn-primary { flex: 1; }

  /* Kalender: statt Monatsraster eine Liste der Tage mit Terminen */
  .calendar-controls { flex-wrap: wrap; gap: 8px; }
  .calendar-grid { display: block; }
  .calendar-weekday { display: none; }
  .calendar-day { display: none; min-height: 0; margin-bottom: 8px; padding: 10px 12px; }
  .calendar-day:has(.calendar-appointment) { display: block; }
  .calendar-day-number { display: none; }
  .calendar-day::before { content: attr(data-date); display: block; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
  .calendar-day-outside { opacity: 1; }
  .calendar-appointment { font-size: 14px; padding: 8px 10px; margin-bottom: 4px; white-space: normal; }
}

/* ---------- Handy Teil C: Datumsfelder (iOS), EQ-Speichern ohne schwebende Leiste ---------- */
@media (max-width: 720px) {
  /* iOS rendert <input type="date"> sonst mit eigener Breite ueber den Rand hinaus */
  input[type="date"], input[type="datetime-local"], input[type="time"], input[type="month"] {
    -webkit-appearance: none; appearance: none;
    display: block; width: 100%; min-width: 0 !important; max-width: 100%; box-sizing: border-box;
    min-height: 46px; text-align: left;
  }
  input[type="date"]::-webkit-date-and-time-value, input[type="datetime-local"]::-webkit-date-and-time-value { text-align: left; margin: 0; }
  .form-row label, .screening-box label, .eq-test-table td { min-width: 0; }

  /* Zwei Speichern-Leisten uebereinander (Kontakt + EQ) verwirren und decken Felder ab:
     "EQ speichern" steht normal am Ende des EQ-Bereichs, volle Breite. */
  .eq-actions { position: static; border-top: none; padding: 6px 0 0; margin-top: 14px; background: transparent; }
  .screening-box { padding: 2px 12px 12px; }
}

/* EQology-Testzeilen: auf allen Bildschirmen als Karten-Raster statt breiter Tabelle
   (Omega: 2 Werte, Mineralien: 4 Werte - passt so immer ins Fenster) */
.eq-table-wrap { overflow: visible; }
.eq-test-table, .eq-test-table tbody { display: block; }
.eq-test-table thead { display: none; }
.eq-test-table tr {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 8px 10px; position: relative;
  border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin-bottom: 10px; background: var(--white);
}
.eq-test-table td { display: block; padding: 0; min-width: 0; }
.eq-test-table td::before { content: attr(data-label); display: block; font-size: 11px; color: var(--ink-soft); margin-bottom: 2px; }
.eq-test-table td.eq-round { grid-column: 1 / -1; font-weight: 700; color: var(--ink); padding-right: 36px; }
.eq-test-table td.eq-round::before, .eq-test-table td.eq-del-cell::before { display: none; }
.eq-test-table td.eq-status-cell { grid-column: 1 / -1; }
.eq-test-table td.eq-del-cell { position: absolute; top: 6px; right: 8px; }
.eq-test-table input { width: 100%; min-width: 0 !important; }
.eq-status-cell select { width: 100%; min-width: 0; }

/* Abstand zwischen Kontakt-Formular (Speichern) und den Bereichen darunter (EQology, Screening ...) */
#leadEditForm { margin-bottom: 22px; }
#leadEditForm .modal-actions { margin-bottom: 4px; }

/* ---------- To-do-Listen ---------- */
.nav-btn { position: relative; }
.nav-badge {
  position: absolute; top: 2px; right: 2px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--coral); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 17px; text-align: center;
}
.nav-mobile-only { display: none; }

.todo-lists { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.todo-chip {
  border: 1px solid var(--line); background: var(--white); padding: 7px 14px; border-radius: 18px;
  font-size: 13px; font-weight: 500; color: var(--ink-soft); cursor: pointer;
}
.todo-chip.active { background: var(--forest); border-color: var(--forest); color: var(--ink); }
.todo-chip-n { display: inline-block; margin-left: 4px; font-weight: 700; opacity: 0.75; }

.todo-add { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; box-shadow: var(--shadow); }
.todo-add > input[type="text"] { width: 100%; padding: 11px 14px; font-size: 15px; border: 1px solid var(--line); border-radius: 10px; background: var(--cream); box-sizing: border-box; }
.todo-add-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.todo-add-row input, .todo-add-row select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); font-size: 13.5px; box-sizing: border-box; }
.todo-contact-wrap { position: relative; flex: 1 1 180px; }
.todo-contact-wrap input { width: 100%; }
.todo-contact-results { position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: var(--white); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); z-index: 30; max-height: 260px; overflow-y: auto; }
.todo-contact-hit { display: block; width: 100%; text-align: left; padding: 10px 12px; border: none; background: none; cursor: pointer; font-size: 14px; }
.todo-contact-hit:hover { background: var(--cream-deep); }
.todo-showdone { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-soft); margin: 4px 0 8px; }
.todo-showdone input { width: auto; margin: 0; }

.todo-group { font-family: var(--font-display); font-size: 14px; margin: 18px 0 8px; }
.todo-group-overdue { color: #A33B2B; }
.todo-group-today { color: #7A3E0C; }
.todo-item {
  display: flex; align-items: flex-start; gap: 12px; background: var(--white); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; margin-bottom: 8px;
}
.todo-done .todo-title { text-decoration: line-through; color: var(--ink-soft); }
.todo-check {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--forest); background: var(--white);
  cursor: pointer; padding: 0; font-size: 14px; line-height: 1; color: var(--ink); margin-top: 1px;
}
.todo-done .todo-check { background: var(--forest); }
.todo-main { flex: 1; min-width: 0; }
.todo-title { font-size: 15px; font-weight: 600; word-break: break-word; }
.todo-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; margin-top: 3px; font-size: 12.5px; align-items: center; }
.todo-tag { background: var(--cream-deep); color: var(--ink-soft); border-radius: 8px; padding: 1px 8px; }
.todo-tag-auto { background: var(--ochre-soft); color: #7A5540; }
.todo-contact { color: var(--forest-deep); font-weight: 600; text-decoration: underline; }
.todo-notes { margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); }
.todo-due-input { flex: 0 0 auto; padding: 5px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); font-size: 12.5px; width: 138px; box-sizing: border-box; }
.todo-due-input.is-overdue { background: #F3D0C8; border-color: #D9A398; color: #7A2A1C; }
.todo-due-input.is-today { background: #F5C9A0; border-color: #E0AE7E; color: #7A3E0C; }
.todo-del { background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 14px; padding: 4px 6px; }
.todo-del:hover { color: var(--coral); }

#todoManage { margin-top: 22px; }
.todo-manage-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.todo-manage-name { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.todo-manage-name .muted { font-size: 12px; }
.todo-manage-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.todo-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; }
.todo-switch input { width: auto; margin: 0; }
.todo-new-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.todo-new-list input, .todo-new-list select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); font-size: 13.5px; }
.todo-new-list input { flex: 1 1 200px; }

@media (max-width: 720px) {
  /* Rufnummern wandern ins "Mehr"-Menue, damit die untere Leiste Platz fuer "To-do" hat */
  .topnav > .nav-btn[data-view="phones"] { display: none; }
  .nav-mobile-only { display: block; }
  .nav-badge { top: 0; right: 4px; }
  .todo-add-row > * { flex: 1 1 100%; }
  .todo-add-row .btn-primary { flex-basis: 100%; }
  .todo-item { flex-wrap: wrap; }
  .todo-main { flex: 1 1 calc(100% - 90px); }
  .todo-item .todo-due-input { width: 150px; max-width: calc(100% - 100px); min-height: 38px; margin-left: 38px; font-size: 14px !important; }
  .todo-manage-row { flex-direction: column; }
}

/* Kopfzeile: Wortmarke (make you RISE) statt Logo-Kreis + Text */
.brand-wordmark { height: 62px; width: auto; display: block; }
@media (max-width: 720px) { .brand-wordmark { height: 40px; } }

/* Lotus neben der Wortmarke */
.brand { align-items: center; gap: 14px; }
.brand-lotus { height: 32px; width: auto; display: block; }
@media (max-width: 720px) { .brand { gap: 6px; } .brand-lotus { height: 22px; } }

/* To-do: Google-Tasks-Kasten in "Listen verwalten" */
.todo-google { background: var(--white); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; font-size: 13.5px; }
.todo-google-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 10px; }

.todo-toolrow { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 8px; }
.todo-toolrow .todo-showdone { margin: 0; }
.todo-toolrow .btn-ghost { padding: 6px 12px; font-size: 12.5px; }

/* Google-Kontakte: neue Synchronisation */
.google-v2 { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.google-v2 h3 { margin: 0 0 6px; font-size: 15px; }
.google-v2-preview { margin-top: 14px; background: var(--cream-deep); border-radius: 10px; padding: 12px 14px; }
.google-v2-preview h4 { margin: 0 0 6px; }
.google-v2-preview ul { margin: 8px 0; padding-left: 18px; font-size: 13.5px; }
.google-v2-preview li { margin-bottom: 4px; }

/* Kundenreminder */
.cr-rule { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cr-rule.cr-off { opacity: 0.55; }
.cr-rule-main { display: flex; flex-direction: column; gap: 2px; font-size: 14px; flex: 1 1 260px; min-width: 0; }
.cr-rule-main .muted { font-size: 12.5px; }
.cr-rule-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.cr-form { margin-top: 14px; }
.cr-form h4 { margin: 0 0 6px; }
.cr-form label { display: block; margin-top: 8px; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.cr-form input[type="text"], .cr-form input[type="number"], .cr-form select { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); font-size: 13.5px; box-sizing: border-box; }
.cr-form input[type="text"] { width: 100%; }
.cr-statuses { border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 10px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 12px; }
.cr-statuses legend { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); padding: 0 6px; }
@media (max-width: 720px) { .cr-rule-actions { width: 100%; } }

.cr-interval select, .cr-interval input { width: auto !important; display: inline-block; }

.login-legal { text-align: center; font-size: 12.5px; margin: 14px 0 0; color: var(--ink-soft); }
.login-legal a { color: var(--ink-soft); }

/* Google-Konten */
.google-banner { background: #FBE3D4; color: #7A2A1C; border-bottom: 1px solid #E9B9A0; padding: 9px 20px; font-size: 13.5px; text-align: center; }
.google-banner .muted-light { opacity: 0.75; }
.google-banner-btn { margin-left: 10px; background: #7A2A1C; color: #fff; padding: 4px 12px; border-radius: 14px; text-decoration: none; font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.ga-account { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; background: var(--white); }
.ga-account.ga-bad { border-color: #E9B9A0; background: #FFF6F1; }
.ga-head { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; }
.ga-pill { font-size: 11.5px; background: var(--cream-deep); color: var(--ink-soft); border-radius: 10px; padding: 2px 9px; }
.ga-pill-ok { background: #DCEBDD; color: #2C5E33; }
.ga-pill-bad { background: #F3D0C8; color: #7A2A1C; }
.ga-assign { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 8px 0; }
.ga-check { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; margin: 0; }
.ga-check input { width: auto; margin: 0; }
.ga-assign select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--cream); font-size: 13px; }
@media (max-width: 720px) { .google-banner { padding: 8px 12px; font-size: 12.5px; text-align: left; } }

.ga-legacy { margin: 10px 0; font-size: 13px; }
.ga-legacy summary { cursor: pointer; color: var(--ink-soft); }
.ga-legacy-list { margin: 6px 0 0; padding-left: 18px; line-height: 1.8; }
