:root {
  /* G.B.V.M. Markenkit (CI-Buch): Nachtblau Grundton, Gold nur Akzent,
     Blau fuer Links und Buttons, Montserrat, eckige Flaechen, 1-px-Linien. */
  --brand-navy: #1d334e;
  --brand-gold: #ffb300;
  --brand-blue: #0068b3;
  --brand-white: #ffffff;
  --surface-alt: #f3f5f8;
  --color-bg: #f3f5f8;
  --color-panel: #ffffff;
  --color-border: #d6dde6;
  --color-text: #1d334e;
  --color-muted: #56657a;
  --color-primary: #0068b3;
  --color-primary-dark: #1d334e;
  --color-accent: #2c7a4b;
  --color-visited: #b45309;
  --color-end: #b6316c;
  --color-todo: #6d28d9;
  font-family: Montserrat, "Segoe UI", system-ui, sans-serif;
}

@font-face { font-family: Montserrat; font-style: normal; font-weight: 400; font-display: swap; src: url("vendor/fonts/montserrat-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 500; font-display: swap; src: url("vendor/fonts/montserrat-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 600; font-display: swap; src: url("vendor/fonts/montserrat-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: Montserrat; font-style: normal; font-weight: 700; font-display: swap; src: url("vendor/fonts/montserrat-latin-700-normal.woff2") format("woff2"); }

* { box-sizing: border-box; }

/* Etwas größere Schrift auf Handy/Tablet (Kollegen tun sich mit der
   Standardgröße schwer) - da fast alles in rem gesetzt ist, skaliert eine
   höhere Root-Schriftgröße die ganze App gleichmäßig mit. */
@media (max-width: 600px) {
  html { font-size: 17px; }
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.4;
}

.topbar {
  background: var(--color-primary-dark);
  color: white;
  padding: 1.25rem 1.5rem;
}
.topbar h1 { margin: 0 0 0.2rem; font-size: 1.15rem; line-height: 1.3; }
.subtitle { margin: 0; opacity: 0.85; font-size: 0.9rem; }

.topbar-logos {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.logo-badge {
  background: white;
  border-radius: 8px;
  padding: 0.35rem 0.6rem;
  display: inline-flex;
  align-items: center;
}
.logo-badge img { display: block; height: 2.2rem; width: auto; }

.user-bar {
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.85rem;
}
.user-bar #user-info { font-weight: 600; }
.scope-toggle { display: flex; align-items: center; gap: 0.35rem; cursor: pointer; font-weight: 400; }
#logout-btn { margin-left: auto; }

main {
  max-width: 900px;
  margin: 1.25rem auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.panel {
  background: var(--color-panel);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 1.25rem;
}

.panel.accent {
  border: 1px solid #bcd9f5;
  border-left: 5px solid var(--color-primary);
  background: linear-gradient(to bottom right, #f2f8ff, var(--color-panel) 40%);
  margin-bottom: 0.5rem;
}

#login-panel {
  max-width: 420px;
  margin: clamp(1.5rem, 6vh, 4rem) auto;
  padding: 2rem 1.75rem;
  text-align: center;
  border: 1px solid #d9e6fb;
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff, #eef5ff);
  box-shadow: 0 20px 45px rgba(16, 61, 120, 0.16);
  animation: login-in 0.55s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes login-in {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.4rem;
  height: 3.4rem;
  margin: 0 auto 1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 8px 18px rgba(26, 95, 180, 0.35);
  animation: login-icon-pop 0.6s cubic-bezier(0.2, 0.8, 0.2, 1) 0.1s backwards;
}
@keyframes login-icon-pop {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}
#login-panel h2 { margin: 0 0 0.3rem; font-size: 1.3rem; }
#login-panel .hint { margin-bottom: 1.5rem; }
#login-panel .field { text-align: left; }
#login-panel button.primary {
  width: 100%;
  padding: 0.85rem;
  font-size: 1.05rem;
  margin-top: 0.4rem;
  transition: transform 0.15s ease, background 0.15s ease;
}
#login-panel button.primary:hover { transform: translateY(-1px); }
#login-panel button.primary:active { transform: translateY(0); }

.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; margin-bottom: 0.4rem; font-size: 0.95rem; }

select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="number"],
input[type="file"],
input[type="date"],
input[type="time"],
textarea {
  width: 100%;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-size: 1rem;
  background: white;
  color: var(--color-text);
  font-family: inherit;
}

.radio-group { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.5rem; }
.radio, .checkbox { font-weight: 400; display: flex; align-items: center; gap: 0.4rem; cursor: pointer; }

.checkbox-list {
  border: 1px solid var(--color-border);
  border-radius: 6px;
  max-height: 200px;
  overflow-y: auto;
  padding: 0.3rem 0.7rem;
  background: white;
}
.checkbox-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.1rem;
  font-weight: 400;
  cursor: pointer;
  border-bottom: 1px solid #f0f2f5;
}
.checkbox-list label:last-child { border-bottom: none; }
.checkbox-list input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 0; }

.hidden { display: none !important; }

.hint { color: var(--color-muted); font-size: 0.85rem; margin: 0.3rem 0 0; }

button {
  cursor: pointer;
  border: none;
  border-radius: 6px;
  padding: 0.65rem 1.1rem;
  font-size: 1rem;
  font-weight: 600;
}
button.primary { background: var(--color-primary); color: white; }
button.primary:hover { background: var(--color-primary-dark); }
button.secondary { background: #eef1f5; color: var(--color-text); border: 1px solid var(--color-border); margin-right: 0.5rem; }
button.secondary:hover { background: #e2e6ec; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button.small { padding: 0.35rem 0.7rem; font-size: 0.85rem; }

.link-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-weight: 600;
  font-size: 0.82rem;
  padding: 0.2rem 0;
  margin-right: 1rem;
  text-decoration: underline;
}

.field-row { display: flex; gap: 0.75rem; }
.field-row .field { flex: 1; }

.error { color: #c0392b; font-size: 0.85rem; margin-top: 0.5rem; }

.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}
.collapsible-title { display: flex; align-items: center; gap: 0.6rem; }
.panel.controls .collapsible-title { margin-bottom: 1rem; }
.collapsible-header h2 { margin: 0; font-size: 1.1rem; }
.collapsible-title label { font-size: 1.1rem; font-weight: 700; }
.chevron { font-size: 1rem; color: var(--color-muted); }

.add-icon {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1;
}

#add-customer-form { margin-top: 1rem; }

.two-col {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.welcome-banner {
  background: linear-gradient(120deg, #eaf6ef, #eef5ff);
  border: 1px solid #cdeadb;
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  animation: welcome-in 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes welcome-in {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.welcome-close {
  background: none;
  border: none;
  font-size: 1.15rem;
  color: var(--color-muted);
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  flex: 0 0 auto;
  line-height: 1;
}
.welcome-close:hover { color: var(--color-text); }
.two-col > .panel {
  flex: 1 1 320px;
  margin-bottom: 0;
  min-width: 0;
}

.tag-checkboxes { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; }
.tag-checkboxes label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 400;
  font-size: 0.9rem;
  cursor: pointer;
}
.tag-checkboxes input[type="checkbox"] { width: auto; }

.divider { border: none; border-top: 1px dashed var(--color-border); margin: 1.25rem 0; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}
@media (min-width: 560px) {
  .stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.stat-tile {
  background: white;
  border: 1px solid #dbe7f8;
  border-radius: 10px;
  padding: 0.85rem 0.6rem;
  text-align: center;
  width: 100%;
  font-family: inherit;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-tile:hover { box-shadow: 0 3px 12px rgba(26, 95, 180, 0.18); transform: translateY(-1px); }
.stat-value { font-size: 1.7rem; font-weight: 800; color: var(--color-primary-dark); line-height: 1.1; }
.stat-label { font-size: 0.78rem; color: var(--color-muted); margin-top: 0.25rem; }
.stat-tile.wide { grid-column: 1 / -1; background: #eaf6ef; border-color: #cdeadb; }
.stat-tile.wide .stat-value { color: #1f7a4d; }

.stat-detail-box { max-width: 480px; text-align: left; max-height: 85vh; overflow-y: auto; }
.stat-detail-header { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.stat-detail-header h2 { margin: 0; font-size: 1.2rem; }
#stat-detail-close { margin: 0; font-size: 1.1rem; text-decoration: none; }
.stat-detail-table { border-collapse: collapse; width: 100%; font-size: 0.9rem; margin-top: 0.5rem; }
.stat-detail-table th, .stat-detail-table td { text-align: left; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--color-border); }
.stat-detail-table th { color: var(--color-muted); font-weight: 600; }
.stat-detail-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.stat-detail-total { margin: 0.6rem 0 0; }
.stat-detail-sub-heading { margin: 1rem 0 0.4rem; font-size: 0.95rem; }
.stat-detail-customer-list { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; max-height: 260px; overflow-y: auto; }
.stat-detail-customer-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--color-border);
}
.stat-detail-customer-list li:last-child { border-bottom: none; }
.stat-detail-customer-list a { color: var(--color-primary); font-weight: 600; text-decoration: none; }
.stat-detail-customer-list a:hover { text-decoration: underline; }
.stat-detail-customer-meta { color: var(--color-muted); font-size: 0.8rem; white-space: nowrap; flex: 0 0 auto; }

#dashboard-breakdown { margin-top: 1.25rem; }
#dashboard-breakdown h3 { margin: 0 0 0.5rem; font-size: 0.95rem; }
.table-scroll { overflow-x: auto; }
#dashboard-breakdown-table { border-collapse: collapse; width: 100%; font-size: 0.85rem; }
#dashboard-breakdown-table th,
#dashboard-breakdown-table td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
#dashboard-breakdown-table th { color: var(--color-muted); font-weight: 600; }

.tags {
  margin-top: 0.4rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: #eaf1fc;
  color: var(--color-primary-dark);
  border: 1px solid #cfe0f5;
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
}
.tag-pill .tag-remove {
  cursor: pointer;
  color: #7b91ab;
  font-weight: 700;
}
.tag-pill .tag-remove:hover { color: #c0392b; }
.tag-add-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  max-width: 260px;
}
.tag-add-form input {
  flex: 1;
  padding: 0.35rem 0.5rem;
  font-size: 0.85rem;
}

.visited-badge {
  margin-top: 0.3rem;
  font-size: 0.82rem;
  color: var(--color-accent);
  font-weight: 600;
}

.visit-controls { margin-top: 0.4rem; }
.visit-form {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 320px;
}
.visit-form textarea {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: 0.5rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.visit-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-weight: 600;
}
.visit-field > span { font-size: 0.8rem; color: var(--color-muted); }
.visit-field input, .visit-field textarea { font-weight: 400; }
.visit-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.visit-form-actions button.secondary { margin-right: 0; }
.visit-history {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  background: #f7f8fa;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
}
.visit-history ul { margin: 0; padding-left: 1.1rem; }

.open-customer-link { color: inherit; text-decoration: none; cursor: pointer; }
.open-customer-link:hover { text-decoration: underline; color: var(--color-primary); }

#deeplink-back-btn { margin-bottom: 0.75rem; }

.contacts-section { margin-top: 1rem; }
.contacts-section h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.contacts-list { list-style: none; margin: 0 0 0.5rem; padding: 0; font-size: 0.9rem; }
.contacts-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--color-border);
}
.contacts-list li:last-child { border-bottom: none; }
.contact-add-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.4rem;
  max-width: 420px;
}
.contact-add-form input { flex: 1 1 120px; }

.visit-history-full { margin-top: 1rem; }
.visit-history-full h3 { margin: 0 0 0.4rem; font-size: 0.95rem; }
.visit-history-list { list-style: none; margin: 0; padding: 0; font-size: 0.88rem; }
.visit-history-list li { padding: 0.5rem 0; border-bottom: 1px solid var(--color-border); }
.visit-history-list li:last-child { border-bottom: none; }
.visit-badges { margin-top: 0.3rem; display: flex; flex-direction: column; gap: 0.2rem; }
.visit-badge-item { color: var(--color-muted); font-size: 0.82rem; }
.visit-badge-item.cancelled { color: #b3261e; text-decoration: line-through; }
.visit-todo-line { margin-top: 0.25rem; font-size: 0.82rem; color: var(--color-todo); }
.visit-todo-line.done { color: var(--color-muted); text-decoration: line-through; }
.cancel-link {
  background: none;
  border: none;
  color: #b3261e;
  font-weight: 600;
  font-size: 0.78rem;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  margin-left: 0.4rem;
}

.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.75rem;
}
#progress-fill {
  height: 100%;
  width: 0%;
  background: var(--color-accent);
  transition: width 0.2s ease;
}
#progress-label { margin: 0.35rem 0 0; font-size: 0.85rem; color: var(--color-muted); }

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.results-header h2 { margin: 0; font-size: 1.15rem; }

.maps-links {
  margin: 0.75rem 0;
  padding: 0.75rem;
  background: #f0f6ff;
  border: 1px solid #cfe0f5;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.maps-links a { color: var(--color-primary); font-weight: 600; }

.map {
  height: 360px;
  border-radius: 8px;
  margin: 1rem 0;
  border: 1px solid var(--color-border);
}

.stop-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: stop;
}
.stop-list li {
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
}
.stop-list li:last-child { border-bottom: none; }
.stop-index {
  flex: 0 0 auto;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}
.stop-index.start { background: var(--color-accent); }
.stop-index.end { background: var(--color-end); }
.stop-index.visited { background: var(--color-visited); }
.stop-body { flex: 1; }
.stop-body .leg { color: var(--color-muted); font-size: 0.82rem; margin-top: 0.15rem; }

/* Kundenkarte: gilt sowohl kompakt im Tourenplaner (.stop-body) als auch
   auf der einzelnen Kundenseite (#deeplink-body), deshalb allgemeine
   Klassen statt an .stop-body gebunden. Reihenfolge/Abstand siehe
   buildCustomerDetailsHtml: Adresse, [Abstand] Kontakt, [Abstand]
   Geschäftsführer. */
.company { font-weight: 700; }
.address { color: var(--color-muted); font-size: 0.9rem; }
.contact { font-size: 0.85rem; margin-top: 0.7rem; }
.contact a { color: var(--color-primary); }
.geschaeftsfuehrer { font-size: 0.85rem; margin-top: 0.7rem; }
.financials {
  margin-top: 0.5rem;
  font-size: 0.82rem;
  color: var(--color-muted);
  background: #fbf3e7;
  border: 1px solid #f0dfc4;
  border-radius: 6px;
  padding: 0.5rem 0.7rem;
  display: inline-block;
}
.financials .label { font-weight: 600; color: #92610c; }
.financials-list { list-style: disc; margin: 0.3rem 0 0; padding-left: 1.2rem; }
.financials-list li { margin-bottom: 0.15rem; }
.financials-list li:last-child { margin-bottom: 0; }

.pension-toggle { margin-top: 0.5rem; font-size: 0.85rem; }

.todo-badge {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--color-todo);
  font-weight: 600;
}
.todo-section { margin-top: 0.5rem; }
.todo-display {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.todo-text { color: var(--color-todo); font-weight: 600; font-size: 0.9rem; }
.todo-edit-form {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-width: 320px;
}

.unresolved {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--color-border);
}
.unresolved h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.unresolved ul { margin: 0.4rem 0 0; padding-left: 1.2rem; }

.search-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.filter-chip {
  background: #eef1f5;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text);
  cursor: pointer;
}
.filter-chip:hover { background: #e2e6ec; }
.filter-chip.active { background: var(--color-primary); border-color: var(--color-primary); color: white; }

.search-results {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  border-top: 1px solid var(--color-border);
}
.search-result { border-bottom: 1px solid var(--color-border); }
.search-result-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.2rem;
  cursor: pointer;
}
.search-result-summary:hover { background: #f7f9fc; }
.search-result-summary .stop-index {
  width: 1.6rem;
  height: 1.6rem;
  font-size: 0.75rem;
  background: var(--color-primary);
}
.search-result-summary .stop-index.visited { background: var(--color-visited); }
.search-result-summary .company { font-weight: 700; font-size: 0.95rem; }
.search-result-summary .address { color: var(--color-muted); font-size: 0.85rem; }
.search-result-detail {
  padding: 0 0.2rem 0.9rem 2.35rem;
}

#admin-import-body { margin-top: 1rem; }
#admin-import-progress { max-width: 320px; }

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1.5rem;
}
.confirm-box {
  background: white;
  border-radius: 16px;
  padding: 2rem 1.5rem;
  max-width: 420px;
  width: 100%;
  text-align: center;
}
.confirm-label { margin: 0; color: var(--color-muted); font-size: 0.9rem; }
.confirm-box h2 { margin: 0.2rem 0 0.75rem; font-size: 1.5rem; }
.confirm-hint { color: var(--color-muted); margin-bottom: 1.5rem; }
.confirm-btn {
  display: block;
  width: 100%;
  background: var(--color-accent);
  color: white;
  font-size: 1.3rem;
  padding: 1.5rem 1rem;
  border-radius: 12px;
  margin-bottom: 1rem;
}
.confirm-btn:hover { background: #237a53; }
.confirm-thanks {
  margin-top: 1rem;
  font-weight: 700;
  color: var(--color-accent);
  font-size: 1.1rem;
}

#confirm-step-outcome .field { text-align: left; }
.yesno-toggle { display: flex; gap: 0.5rem; }
.yesno-btn {
  flex: 1;
  background: #eef1f5;
  color: var(--color-text);
  border: 2px solid transparent;
  padding: 0.55rem;
}
.yesno-btn.active { background: var(--color-primary); color: white; }
.yesno-toggle[data-field="consultation"] .yesno-btn.active { background: var(--color-visited); }
#outcome-skip-btn { width: 100%; }

.qr-code {
  margin-top: 0.5rem;
  display: none;
}
.qr-code svg { width: 76px; height: 76px; }

.print-only { display: none; }
.print-reminder {
  border: 2px solid #103d78;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

footer {
  max-width: 900px;
  margin: 0 auto 2rem;
  padding: 0 1rem;
  color: var(--color-muted);
  font-size: 0.8rem;
}

@media print {
  .topbar, .controls, .maps-links, .map, footer, .results-actions,
  #dashboard-panel, #deeplink-panel, #search-panel, #add-customer-panel,
  #import-panel, #admin-import-panel, .visit-controls { display: none !important; }
  body { background: white; }
  .panel { border: none; padding: 0; }
  .print-only { display: block; }
  .qr-code { display: block; }
  .stop-list li { break-inside: avoid; }
}

/* ---------- Benutzer (nur Admin): Name + Funktionen ---------- */
.users-list { display: grid; gap: 0.9rem; margin-top: 0.8rem; }
.user-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.9rem 1rem;
  background: #f8fafc;
}
.user-card-head { font-weight: 600; margin-bottom: 0.6rem; word-break: break-all; }
.user-card-label { display: block; font-weight: 600; margin-bottom: 0.6rem; }
.user-card-label input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  font-size: 1.05rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
}
.user-card-functions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.7rem; }
.big-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 48px;
  padding: 0.4rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  font-size: 1.05rem;
  cursor: pointer;
}
.big-check input { width: 1.3rem; height: 1.3rem; }
.user-card button.primary { min-height: 48px; font-size: 1.05rem; }

/* ---------- Dublettenschutz ---------- */
.dupe-box {
  border: 2px solid #d97706;
  background: #fff7ed;
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  font-size: 1.05rem;
}
.dupe-box.sure { border-color: #b91c1c; background: #fef2f2; }
.dupe-title { font-weight: 700; margin: 0 0 0.5rem; font-size: 1.1rem; }
.dupe-item { padding: 0.5rem 0; border-top: 1px solid rgba(0, 0, 0, 0.1); }
.dupe-item:first-of-type { border-top: none; }
.dupe-reason { color: #92400e; font-size: 0.9rem; }
.dupe-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.dupe-actions button, .dupe-box > button { min-height: 48px; font-size: 1rem; }
.register { color: var(--color-muted); font-size: 0.9rem; margin-top: 0.2rem; }

.import-preview { margin-top: 1rem; display: grid; gap: 0.7rem; }
.import-summary { display: grid; gap: 0.2rem; font-size: 1.05rem; }
.import-preview details ul { max-height: 240px; overflow: auto; margin: 0.4rem 0; font-size: 0.9rem; }
.review-card {
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  background: #f8fafc;
  margin-bottom: 0.7rem;
}
.review-option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  cursor: pointer;
}
.review-option input { width: 1.2rem; height: 1.2rem; margin-top: 0.15rem; flex-shrink: 0; }
.dupe-groups { margin-top: 0.7rem; }


/* =====================================================================
   G.B.V.M.-Erscheinungsbild + CRM-Startseite (Abschnitt 3)
   Grosse Schrift und Knoepfe fuer alle Altersgruppen, breit auf grossen
   Bildschirmen, einspaltig auf dem Handy.
   ===================================================================== */
html { font-size: 17px; }
@media (max-width: 600px) { html { font-size: 18px; } }
body { font-family: Montserrat, "Segoe UI", system-ui, sans-serif; color: var(--color-text); background: var(--color-bg); line-height: 1.5; }
a { color: var(--brand-blue); }
:focus-visible { outline: 2px solid var(--brand-blue); outline-offset: 2px; }
.kennung { font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase; font-weight: 600; }
.view-hidden { display: none !important; }

/* Kopf: Nachtblau-Band mit weissem Logo (wie Maklerportal) */
.topbar { background: var(--brand-navy); color: #fff; padding: 0; }
.topbar-inner, .user-bar {
  max-width: 1560px;
  margin-inline: auto;
  padding-inline: max(16px, 2.5vw);
}
.topbar-inner { display: flex; align-items: center; gap: 1.5rem; padding-block: 1rem; flex-wrap: wrap; }
.brand-link { display: block; flex: none; line-height: 0; }
.brand-logo { width: 120px; height: 120px; display: block; }
.brand-text { display: grid; gap: 0.15rem; flex: 1 1 16rem; min-width: 0; }
.brand-text .kennung { color: #aab8ca; }
.topbar h1 { font-size: 1.9rem; line-height: 1.2; font-weight: 700; margin: 0; color: #fff; }
.topbar .subtitle { color: #aab8ca; opacity: 1; font-size: 0.95rem; margin: 0; }
.partner-badge { background: #fff; padding: 0.35rem 0.5rem; line-height: 0; flex: none; }
.partner-badge img { height: 46px; width: auto; display: block; }
.topbar-inner { border-bottom: 1px solid #2e4866; }
.user-bar {
  margin: 0 auto;
  padding-block: 0.6rem;
  font-size: 0.9rem;
  color: #fff;
}
.user-bar label, .user-bar .scope-toggle { color: #fff; }
.scope-toggle input { width: 1.2rem; height: 1.2rem; accent-color: var(--brand-gold); }
.user-bar #user-info { font-weight: 600; }
button.ghost { background: transparent; color: #fff; border: 1px solid #aab8ca; }
button.ghost:hover { background: rgba(255, 255, 255, 0.1); }
@media (max-width: 700px) {
  .topbar-inner { flex-wrap: nowrap; gap: 0.75rem; padding-block: 0.5rem; }
  .brand-logo { width: 72px; height: 72px; }
  .brand-text .kennung, .topbar .subtitle { display: none; }
  .topbar h1 { font-size: 1.25rem; }
  .partner-badge img { height: 30px; }
  .user-bar { gap: 0.5rem 0.75rem; font-size: 0.85rem; }
  .tile { min-height: 0; padding: 1.1rem 1.25rem; }
  .tile-label { font-size: 1.3rem; }
  .home-head h2 { font-size: 1.6rem; }
  .panel, .panel.accent { padding: 1rem; }
  .view-bar h2 { font-size: 1.35rem; }
}

/* Breite: auf grossen Bildschirmen (z. B. 1920 x 1080) deutlich breiter */
main { max-width: 1560px; padding: 0 max(16px, 2.5vw); margin: 1.5rem auto 2rem; }
#app-root { display: flex; flex-direction: column; gap: 1.25rem; }

/* Flaechen: eckig, 1-px-Linien, keine Verlaeufe/Schatten */
.panel, .panel.accent {
  border: 1px solid var(--color-border);
  border-radius: 0;
  background: var(--color-panel);
  box-shadow: none;
  margin-bottom: 0;
  padding: 1.5rem;
}
.panel h2, .panel h3 { color: var(--brand-navy); font-weight: 700; }
[data-view] > .collapsible-header, [data-view] > .collapsible-title { display: none; }
.collapsible-header { cursor: default; }

button, .button-like { border-radius: 4px; font-family: inherit; font-size: 1rem; min-height: 48px; padding: 0.6rem 1.2rem; font-weight: 600; }
button.small { min-height: 40px; font-size: 0.9rem; padding: 0.4rem 0.9rem; }
button.primary { background: var(--brand-blue); color: #fff; border: 1px solid var(--brand-blue); }
button.primary:hover { background: var(--brand-navy); border-color: var(--brand-navy); }
button.secondary { background: #fff; color: var(--brand-navy); border: 1px solid var(--brand-navy); }
button.secondary:hover { background: var(--surface-alt); }
input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="date"], input[type="time"], input[type="number"], select, textarea {
  font-family: inherit;
  font-size: 1rem;
  border-radius: 4px;
  border: 1px solid #aab8ca;
  min-height: 48px;
  color: var(--color-text);
}
label { color: var(--brand-navy); }
.hint { color: var(--color-muted); font-size: 0.9rem; }

/* Anmeldung */
#login-panel { border-radius: 0; background: #fff; box-shadow: none; border: 1px solid var(--color-border); border-top: 4px solid var(--brand-navy); animation: none; }
.login-logo { width: 140px; height: 140px; display: block; margin: -0.5rem auto 0.5rem; }
#login-panel button.primary { width: 100%; }

/* Willkommensgruss */
.welcome-banner { background: #fff; border: 1px solid var(--color-border); border-left: 4px solid var(--brand-gold); border-radius: 0; color: var(--brand-navy); animation: none; }

/* Ansichtsleiste: Zurueck + Titel */
.view-bar {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--brand-navy);
  padding-bottom: 0.75rem;
}
.view-bar h2 { margin: 0; font-size: 1.6rem; font-weight: 700; color: var(--brand-navy); }
.back-home { background: #fff; color: var(--brand-navy); border: 1px solid var(--brand-navy); font-size: 1.05rem; }
.back-home:hover { background: var(--surface-alt); }

/* Startseite */
.home-head { display: grid; gap: 0.35rem; margin-bottom: 1.25rem; }
.home-head .kennung { color: var(--color-muted); }
.home-head h2 { margin: 0; font-size: 2rem; line-height: 1.2; font-weight: 700; color: var(--brand-navy); }
.gold-rule { display: block; width: 64px; height: 2px; background: var(--brand-gold); margin-top: 0.4rem; }
.tile-grid {
  display: grid;
  gap: 0;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  border-top: 1px solid var(--color-border);
  border-left: 1px solid var(--color-border);
}
.tile {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.45rem;
  min-height: 170px;
  padding: 1.5rem;
  background: #fff;
  color: var(--brand-navy);
  text-decoration: none;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.tile .kennung { color: var(--color-muted); }
.tile::after { content: ""; display: block; width: 48px; height: 1px; background: var(--brand-gold); order: 1; margin-top: 0.2rem; }
.tile-label { font-size: 1.45rem; line-height: 1.25; font-weight: 700; order: 2; }
.tile-sub { color: var(--color-muted); font-size: 0.95rem; order: 3; }
.tile .kennung { order: 0; }
.tile-badge { order: 4; justify-self: start; font-size: 0.75rem; font-weight: 600; padding: 2px 8px; background: var(--surface-alt); color: var(--color-muted); border: 1px solid var(--color-border); }
a.tile:hover, a.tile:focus-visible { background: var(--brand-navy); color: #fff; }
a.tile:hover .kennung, a.tile:hover .tile-sub, a.tile:focus-visible .kennung, a.tile:focus-visible .tile-sub { color: #aab8ca; }
.tile-soon { color: #7a8799; }
.tile-soon .tile-label { color: #56657a; }

/* Dashboard-Kacheln im CI */
.stat-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); }
.stat-tile { border-radius: 0; border: 1px solid var(--color-border); background: #fff; }
.stat-tile:hover { box-shadow: none; transform: none; border-color: var(--brand-navy); }
.stat-tile .stat-value { color: var(--brand-navy); }
.stat-tile.wide { background: var(--surface-alt); border-color: var(--color-border); }
.stat-tile.wide .stat-value { color: var(--brand-navy); }

/* Dubletten-/Pruefkarten eckig */
.dupe-box, .review-card, .user-card, .big-check { border-radius: 0; }

/* Breite Bildschirme: Tour mit Einstellungen links, Ergebnis/Karte rechts */
@media (min-width: 1280px) {
  body[data-screen="tour"] #app-root {
    display: grid;
    grid-template-columns: minmax(380px, 460px) minmax(0, 1fr);
    align-items: start;
  }
  body[data-screen="tour"] #app-root > * { grid-column: 1 / -1; }
  body[data-screen="tour"] #app-root > .controls { grid-column: 1; position: sticky; top: 1rem; }
  body[data-screen="tour"] #app-root > #results-panel { grid-column: 2; }
  body[data-screen="tour"] .map { height: 560px; }
  body[data-screen="zahlen"] .stat-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  body[data-screen="zahlen"] .stat-tile.wide { grid-column: span 2; }
  #add-customer-form .field-row { gap: 1.25rem; }
  body[data-screen="neu"] #add-customer-panel,
  body[data-screen="benutzer"] #users-panel, body[data-screen="drucken"] #print-panel { max-width: 1100px; }
  .users-list { grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); }
}

@media print {
  .view-bar, #home-view, #print-panel, #users-panel, .welcome-banner, .user-bar { display: none !important; }
  body[data-screen] #app-root { display: block !important; }
}

/* ---------- Anrufen (Pre-Sales), fuers Handy optimiert ---------- */
.call-tabs { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--brand-navy); margin-bottom: 1.25rem; }
.call-tab { border: 0; border-radius: 0; background: #fff; color: var(--brand-navy); font-size: 1.1rem; min-height: 56px; }
.call-tab + .call-tab { border-left: 1px solid var(--brand-navy); }
.call-tab.active { background: var(--brand-navy); color: #fff; }
.call-tab-count { display: inline-block; min-width: 1.6em; padding: 0 0.35em; margin-left: 0.3em; background: var(--brand-gold); color: var(--brand-navy); font-weight: 700; }
.callback-list { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.6rem; }
.callback-item { border: 1px solid var(--color-border); border-left: 4px solid var(--color-border); background: #fff; display: grid; }
.callback-item.today { border-left-color: var(--brand-gold); }
.callback-item.overdue { border-left-color: #b91c1c; }
.callback-main { display: grid; gap: 0.15rem; text-align: left; background: transparent; border: 0; border-radius: 0; padding: 0.9rem 1rem; color: var(--brand-navy); font-weight: 400; min-height: 0; cursor: pointer; }
.callback-main:hover { background: var(--surface-alt); }
.callback-when { font-weight: 700; font-size: 1rem; }
.callback-item.overdue .callback-when { color: #b91c1c; }
.callback-firm { font-size: 1.2rem; font-weight: 700; }
.callback-place, .callback-note { color: var(--color-muted); font-size: 0.95rem; }
.callback-open { padding: 0 1rem 0.8rem; font-size: 0.95rem; }
.empty-hint { color: var(--color-muted); padding: 1rem; border: 1px dashed var(--color-border); list-style: none; }
.call-info { font-size: 1.05rem; margin: 0.5rem 0 1rem; }
.big-btn { min-height: 60px; font-size: 1.15rem; width: 100%; max-width: 520px; }

.call-card { display: grid; gap: 1rem; max-width: 720px; }
.call-card-head h3 { font-size: 1.7rem; line-height: 1.25; margin: 0.3rem 0 0.2rem; color: var(--brand-navy); }
.call-card-head .kennung { color: var(--color-muted); }
.call-address { margin: 0; font-size: 1.05rem; }
.call-people { margin: 0.4rem 0 0; font-size: 1.05rem; }
.call-warnings { display: grid; gap: 0.4rem; }
.call-warn { margin: 0; padding: 0.6rem 0.8rem; font-size: 1rem; border-left: 4px solid; background: var(--surface-alt); }
.call-warn-stop { border-color: #b91c1c; background: #fef2f2; color: #7f1d1d; font-weight: 700; }
.call-warn-call { border-color: var(--brand-gold); background: #fff8e6; }
.call-warn-info { border-color: var(--brand-blue); }
.call-warning { color: #7f1d1d; font-weight: 600; }
.call-phone {
  display: grid;
  justify-items: center;
  gap: 0.1rem;
  padding: 1rem;
  background: #1f7a4d;
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  min-height: 84px;
}
.call-phone:hover, .call-phone:focus-visible { background: #17603c; }
.call-phone-label { font-size: 1rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.call-phone-number { font-size: 1.7rem; font-weight: 700; }
.call-field { display: grid; gap: 0.3rem; font-weight: 600; color: var(--brand-navy); }
.call-field input { width: 100%; padding: 0.5rem 0.7rem; font-size: 1.05rem; }
.call-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.call-results { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6rem; }
.result-btn { min-height: 72px; font-size: 1.15rem; border-radius: 4px; background: #fff; color: var(--brand-navy); border: 2px solid var(--brand-navy); }
.result-btn:hover { background: var(--surface-alt); }
.result-termin { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.result-termin:hover { background: var(--brand-navy); border-color: var(--brand-navy); }
.call-card.dialed .call-results { outline: 3px solid var(--brand-gold); outline-offset: 4px; }
.call-more { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; }
.call-subform { display: grid; gap: 0.8rem; border: 1px solid var(--color-border); padding: 1rem; background: var(--surface-alt); }
.call-subform h4 { margin: 0; font-size: 1.25rem; color: var(--brand-navy); }
.call-step { margin: 0.3rem 0 0; font-weight: 700; color: var(--brand-navy); }
.quick-dates, .choice-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.choice-btn { background: #fff; color: var(--brand-navy); border: 2px solid var(--brand-navy); min-height: 56px; font-size: 1.05rem; flex: 1 1 12rem; }
.choice-btn.active { background: var(--brand-navy); color: #fff; }
.call-subform-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.call-foot { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; padding-top: 0.5rem; border-top: 1px solid var(--color-border); font-size: 1rem; }
.link-btn { background: none; border: 0; color: var(--brand-blue); text-decoration: underline; min-height: 44px; padding: 0; font-weight: 600; cursor: pointer; }
.call-msg { margin: 0; font-weight: 600; }
.call-msg.error { color: #b91c1c; }

.toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  transform: translate(-50%, 150%);
  max-width: min(92vw, 640px);
  background: var(--brand-navy);
  color: #fff;
  padding: 0.9rem 1.2rem;
  border-left: 4px solid var(--brand-gold);
  font-weight: 600;
  z-index: 3000;
  transition: transform 0.25s ease;
}
.toast.show { transform: translate(-50%, 0); }

.status-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.4rem; }
.status-chip { font-size: 0.8rem; padding: 2px 8px; border: 1px solid var(--brand-blue); color: var(--brand-blue); background: #fff; }
.status-chip.stop { border-color: #b91c1c; color: #b91c1c; font-weight: 700; }
.status-chip.muted { border-color: var(--color-border); color: var(--color-muted); }
.firm-activity { border-top: 1px solid var(--color-border); margin-top: 1rem; padding-top: 1rem; display: grid; gap: 0.6rem; }
.firm-activity h3 { margin: 0; }
.firm-activity > button { justify-self: start; }
.activity-list { margin: 0; padding-left: 1.1rem; display: grid; gap: 0.3rem; }
.activity-date { color: var(--color-muted); font-variant-numeric: tabular-nums; }
.block-title { margin: 0 0 0.75rem; font-size: 1.3rem; }
.period-switch { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.period-btn { background: #fff; color: var(--brand-navy); border: 1px solid var(--brand-navy); min-height: 44px; }
.period-btn.active { background: var(--brand-navy); color: #fff; }
.stat-tile.static { cursor: default; }
.tile-count { background: var(--brand-gold); color: var(--brand-navy); border-color: var(--brand-gold); }
@media (max-width: 420px) {
  .call-results { grid-template-columns: 1fr; }
  .call-field-row { grid-template-columns: 1fr; }
}
@media print { #call-view, #presales-stats { display: none !important; } }
.call-tab { min-width: 0; padding: 0.5rem; white-space: normal; line-height: 1.25; }
@media (max-width: 420px) { .call-tab { font-size: 0.92rem; } }
.call-foot a { color: var(--brand-blue); text-decoration: underline; font-weight: 600; }

/* Kachel-Icons (Linien-Symbole wie die feine Linie im Logo) */
.tile-head { order: 2; display: flex; align-items: center; gap: 0.7rem; }
.tile-head .tile-label { order: 0; }
.tile-icon { width: 2.1rem; height: 2.1rem; flex: none; color: var(--brand-navy); }
a.tile:hover .tile-icon, a.tile:focus-visible .tile-icon { color: var(--brand-gold); }
@media (max-width: 700px) { .tile-icon { width: 1.8rem; height: 1.8rem; } }

/* Meine Termine */
.appt-group { margin-bottom: 1.5rem; }
.appt-group h3 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.appt-group.overdue h3 { color: #b91c1c; }
.appt-done summary { cursor: pointer; font-weight: 700; font-size: 1.1rem; color: var(--brand-navy); padding: 0.5rem 0; }
.callback-item.done { opacity: 0.85; }
.appt-when { font-size: 1.25rem; font-weight: 700; margin: 0.4rem 0 0; }
.appt-links { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.secondary-link { display: inline-flex; align-items: center; min-height: 48px; padding: 0.5rem 1rem; border: 1px solid var(--brand-navy); color: var(--brand-navy); text-decoration: none; font-weight: 600; border-radius: 4px; background: #fff; }
.secondary-link:hover { background: var(--surface-alt); }
.followup { display: grid; gap: 0.6rem; }
.sparten-list { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; justify-content: center; margin-top: 0.4rem; }
#appt-view .call-results { grid-template-columns: 1fr; max-width: 520px; }
@media print { #appt-view, #appt-stats { display: none !important; } }
.yesno-row { display: grid; grid-template-columns: 1fr 1fr; }
.table-scroll { margin-top: 1rem; overflow-x: auto; }
.table-scroll table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.table-scroll th, .table-scroll td { text-align: left; padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--color-border); white-space: nowrap; }
.table-scroll th { background: var(--surface-alt); color: var(--brand-navy); font-weight: 700; }
.table-scroll td:not(:first-child), .table-scroll th:not(:first-child) { text-align: right; }

/* Kette an der Firma: wer hat was gemacht */
.status-chip.chain { border-color: var(--brand-navy); color: var(--brand-navy); background: var(--surface-alt); }
.chain { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0; }
.chain-step { display: grid; grid-template-columns: 2.4rem 1fr; gap: 0.8rem; padding: 0.7rem 0; border-left: 2px solid var(--color-border); margin-left: 1.15rem; padding-left: 0; position: relative; }
.chain-num { margin-left: -1.25rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border: 2px solid var(--color-border); background: #fff; color: var(--color-muted); font-weight: 700; border-radius: 9999px; }
.chain-step.active .chain-num { border-color: var(--brand-gold); color: var(--brand-navy); }
.chain-step.done .chain-num { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.chain-step.done { border-left-color: var(--brand-navy); }
.chain-body p { margin: 0.2rem 0 0; }
.chain-body .kennung { color: var(--color-muted); }
.activity-title { margin: 0.8rem 0 0; font-size: 1rem; color: var(--brand-navy); }

/* Drucken/Export nur fuer den Admin: bei Kolleg:innen druckt der Browser
   nur einen Hinweis statt der Daten. */
@media print {
  body.no-print > * { display: none !important; }
  body.no-print::before { content: "Drucken ist nur für den Admin der G.B.V.M. GmbH freigegeben."; display: block; padding: 2rem; font-size: 14pt; }
}

/* ---------- Firmen-Seite: kompakt, grosse Knoepfe, zwei Spalten ---------- */
#deeplink-panel { padding: 0; border: 0; background: transparent; }
.firm-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.firm-hero, .firm-card, .firm-actions { background: #fff; border: 1px solid var(--color-border); }
.firm-hero { padding: 1.25rem 1.5rem; display: grid; gap: 1rem; border-top: 4px solid var(--brand-navy); }
.firm-hero h2 { margin: 0; font-size: 1.8rem; line-height: 1.2; color: var(--brand-navy); }
.firm-hero-address { margin: 0.3rem 0 0; font-size: 1.05rem; color: var(--color-muted); }
.firm-contact { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); }
.contact-btn { display: grid; gap: 0.1rem; padding: 0.8rem 1rem; text-decoration: none; border: 2px solid var(--brand-navy); color: var(--brand-navy); background: #fff; border-radius: 4px; min-height: 64px; }
.contact-btn:hover { background: var(--surface-alt); }
.contact-label { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.contact-value { font-size: 1.15rem; font-weight: 700; word-break: break-word; }
.contact-call { background: #1f7a4d; border-color: #1f7a4d; color: #fff; }
.contact-call:hover { background: #17603c; }
.contact-call .contact-value { font-size: 1.5rem; }
.contact-mail { background: var(--brand-blue); border-color: var(--brand-blue); color: #fff; }
.contact-mail:hover { background: var(--brand-navy); border-color: var(--brand-navy); }
.contact-missing { border-style: dashed; color: var(--color-muted); }
.firm-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 0; border-width: 1px 0 0 1px; background: transparent; }
.action-tile { display: grid; gap: 0.2rem; text-align: left; align-content: start; padding: 1rem 1.2rem; min-height: 92px; background: #fff; color: var(--brand-navy); border: 0; border-right: 1px solid var(--color-border); border-bottom: 1px solid var(--color-border); border-radius: 0; cursor: pointer; }
.action-tile:hover { background: var(--surface-alt); }
.action-tile.primary-tile { background: var(--brand-navy); color: #fff; }
.action-tile.primary-tile:hover { background: #142438; }
.action-tile.primary-tile .action-sub { color: #aab8ca; }
.action-label { font-size: 1.2rem; font-weight: 700; }
.action-sub { font-size: 0.9rem; font-weight: 400; color: var(--color-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.firm-col { display: grid; gap: 1rem; align-content: start; min-width: 0; }
.firm-card { padding: 1.1rem 1.25rem; min-width: 0; scroll-margin-top: 1rem; }
.firm-card > h3, .firm-card h3:first-child { margin: 0 0 0.6rem; font-size: 1.2rem; color: var(--brand-navy); }
.firm-card .firm-activity { border-top: 0; margin-top: 0; padding-top: 0; }
.firm-details .company, .firm-details .address, .firm-details .contact, .firm-details .register, .firm-details .status-chips { display: none; }
.firm-details .geschaeftsfuehrer { margin-top: 0; font-size: 1.05rem; }
.firm-card .contacts-section h3 { margin-top: 0; }
@media (min-width: 1100px) {
  .firm-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); }
  .firm-hero, .firm-actions { grid-column: 1 / -1; }
  .firm-hero { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: start; }
}
@media (max-width: 700px) {
  .firm-hero { padding: 1rem; }
  .firm-hero h2 { font-size: 1.45rem; }
  .firm-actions { grid-template-columns: 1fr 1fr; }
  .action-tile { min-height: 80px; padding: 0.8rem; }
  .action-label { font-size: 1.05rem; }
}

/* ---------- Suche: Liste A-Z mit Filtern ---------- */
.search-filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0; }
.filter-chip { min-height: 44px; padding: 0.4rem 0.9rem; border: 1px solid var(--brand-navy); background: #fff; color: var(--brand-navy); border-radius: 999px; font-weight: 600; font-size: 0.95rem; }
.filter-chip.active { background: var(--brand-navy); color: #fff; }
.search-count { margin: 0.25rem 0 0.5rem; font-weight: 600; color: var(--color-muted); }
.search-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; border-top: 1px solid var(--color-border); }
.search-letter { list-style: none; padding: 0.6rem 0.25rem 0.2rem; font-weight: 700; font-size: 1.1rem; color: var(--brand-gold); border-bottom: 1px solid var(--color-border); background: transparent; }
.search-result { display: flex; align-items: center; gap: 0.75rem; border-bottom: 1px solid var(--color-border); padding: 0; background: #fff; border-radius: 0; }
.search-result-summary { flex: 1; display: flex; gap: 0.75rem; align-items: flex-start; padding: 0.75rem 0.5rem; cursor: pointer; min-width: 0; }
.search-result-summary:hover { background: var(--surface-alt); }
.search-result .company { font-weight: 700; font-size: 1.1rem; color: var(--brand-navy); }
.search-call { flex: none; display: grid; justify-items: center; gap: 0.1rem; width: 72px; padding: 0.5rem 0.25rem; margin-right: 0.4rem; color: #1f7a4d; text-decoration: none; font-size: 0.75rem; font-weight: 700; border: 1px solid #1f7a4d; border-radius: 4px; }
.search-call svg { width: 1.5rem; height: 1.5rem; }
.search-call:hover { background: #1f7a4d; color: #fff; }
#search-more { margin-top: 0.75rem; }

/* Startseite: Spruch */
.home-saying { margin: 0.2rem 0 0; font-size: 1.1rem; color: var(--color-muted); font-style: italic; max-width: none; }

/* Eigentumshinweis */
.data-notice { margin: 1rem 0 0; padding: 0.6rem 0.8rem; border-left: 3px solid var(--brand-gold); background: var(--surface-alt); font-size: 0.85rem; color: var(--color-muted); }
footer .data-notice { max-width: 900px; margin: 0 auto 0.5rem; }
@media print { .data-notice { display: block !important; } }

.firm-hero .status-chips { gap: 0.4rem; margin-top: 0.7rem; }
.firm-hero .status-chip { display: inline-block; padding: 0.25rem 0.6rem; font-size: 0.85rem; line-height: 1.3; }
.firm-details .tags-section, .firm-details .tag-list { margin-top: 0.8rem; }
@media (max-width: 700px) {
  .firm-contact { grid-template-columns: 1fr 1fr; }
  .contact-call, .contact-mail { grid-column: 1 / -1; }
  .contact-web .contact-value, .contact-route .contact-value { font-size: 0.95rem; }
}

/* Rechtlicher Hinweis: deutlich abgesetzt (Warnrot) */
.data-notice {
  margin: 1rem auto 0.75rem;
  max-width: 1100px;
  padding: 0.9rem 1.1rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-left: 6px solid #b91c1c;
  color: #7f1d1d;
  font-size: 0.92rem;
  line-height: 1.5;
  text-align: left;
}
.data-notice p { margin: 0 0 0.4rem; }
.data-notice p:last-child { margin-bottom: 0; }
.data-notice-title { font-weight: 700; font-size: 1rem; color: #991b1b; text-transform: none; }
.data-notice strong { color: #991b1b; }
footer .data-notice { max-width: 1100px; }

/* Rechtlicher Hinweis als Band ueber die volle Bildschirmbreite;
   auf dem Handy eingeklappt ("Ganz anzeigen ...") */
footer { max-width: none; padding: 0; margin: 2rem 0 0; }
footer .data-notice,
.data-notice {
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-top: 4px solid #b91c1c;
  border-bottom: 1px solid #fca5a5;
  background: #fef2f2;
}
.data-notice-inner { max-width: 1560px; margin: 0 auto; padding: 1rem max(16px, 2.5vw); }
.footer-meta { max-width: 1560px; margin: 0 auto; padding: 0.75rem max(16px, 2.5vw) 2rem; }
.notice-toggle { position: absolute; opacity: 0; pointer-events: none; }
.notice-toggle-label { display: none; }
@media (max-width: 700px) {
  .notice-more { display: none; }
  .notice-toggle:checked ~ .notice-more { display: block; }
  .notice-toggle-label { display: inline-block; margin-top: 0.3rem; color: #991b1b; font-weight: 700; text-decoration: underline; cursor: pointer; min-height: 44px; line-height: 44px; }
  .notice-toggle-label .less { display: none; }
  .notice-toggle:checked ~ .notice-toggle-label .more { display: none; }
  .notice-toggle:checked ~ .notice-toggle-label .less { display: inline; }
}
@media print { .notice-more { display: block !important; } .notice-toggle-label { display: none !important; } }

/* Finanzkennzahlen als Raster */
.financials { background: var(--surface-alt); border: 1px solid var(--color-border); border-left: 4px solid var(--brand-gold); border-radius: 0; padding: 0.8rem 1rem; }
.financials .label { color: var(--brand-navy); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.04em; }
.fin-grid { display: grid; gap: 0.8rem 1.5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); margin-top: 0.6rem; }
.fin-group-title { display: block; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--color-muted); border-bottom: 1px solid var(--color-border); padding-bottom: 0.2rem; margin-bottom: 0.3rem; }
.fin-group dl { display: grid; grid-template-columns: 1fr auto; gap: 0.15rem 0.75rem; margin: 0; }
.fin-group dt { color: var(--color-text); }
.fin-group dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; color: var(--brand-navy); }
.gegenstand { margin-top: 0.6rem; font-size: 0.95rem; }
.gegenstand .label { font-weight: 700; }
.nd-status { margin-top: 0.4rem; color: #b91c1c; font-weight: 700; }
.firm-details .gegenstand { display: block; }
.financials { display: block; width: auto; max-width: none; margin-top: 0.8rem; }
