/* ============================================================
   Partner Portal CSS — Mobile First
   ============================================================ */

:root {
  --p-bg: #f2f2ed;
  --p-card: #ffffff;
  --p-header: #006E3A;
  --p-primary: #006E3A;
  --p-green: #006E3A;
  --p-amber: #d97706;
  --p-red: #D42B2B;
  --p-gray-1: #2D332D;
  --p-gray-2: #374151;
  --p-gray-3: #6b7280;
  --p-gray-4: #d1d5db;
  --p-gray-5: #f9fafb;
  --p-nav-h: 64px;
  --p-radius: 12px;
  --p-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

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

html { -webkit-text-size-adjust: 100%; }

body.portal-body {
  background: #ddddd5;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  color: var(--p-gray-1);
  line-height: 1.4;
}

/* ---- Phone shell (centered on desktop) ---- */

.portal-shell {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--p-bg);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.18);
}

/* ---- Header ---- */

.portal-header {
  background: #ffffff;
  color: var(--p-gray-1);
  padding: 14px 16px 12px;
  display: grid;
  grid-template-columns: 84px 1fr 84px;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--p-gray-4);
}

.portal-header-logo {
  height: 28px;
  width: auto;
  justify-self: start;
}

.portal-header-info {
  min-width: 0;
  text-align: center;
}

.portal-header-right {
  justify-self: end;
  display: flex;
  align-items: center;
}

.portal-header-name {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  word-break: break-word;
}

/* ---- Stats bar ---- */

.portal-stats {
  background: var(--p-gray-5);
  display: flex;
  padding: 10px 0;
  border-top: 1px solid var(--p-gray-4);
}

.portal-stats-item {
  flex: 1;
  text-align: center;
}

.portal-stats-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--p-gray-1);
  line-height: 1;
}

.portal-stats-label {
  font-size: 9px;
  color: var(--p-gray-3);
  margin-top: 3px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.portal-stats-divider {
  width: 1px;
  background: var(--p-gray-4);
  margin: 4px 0;
}

/* ---- Main content ---- */

.portal-main {
  flex: 1;
  padding: 12px 12px calc(var(--p-nav-h) + 8px);
  overflow-y: auto;
}

/* ---- Warning banner ---- */

.portal-warning {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #78350f;
}

/* ---- Lead cards ---- */

.lead-card {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  margin-bottom: 10px;
  overflow: hidden;
  border-left: 4px solid var(--p-primary);
}

.lead-card[data-pipenew="true"],
.lead-card[data-urgent="true"] { border-left-color: var(--p-red); }

.lead-card-top {
  padding: 11px 12px 6px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.lead-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--p-gray-1);
  margin-top: 5px;
}

.lead-card-time {
  font-size: 11px;
  color: var(--p-gray-3);
  white-space: nowrap;
  flex-shrink: 0;
  margin-left: 8px;
}

.lead-card-meta {
  padding: 0 12px 6px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--p-gray-3);
}

.lead-card-meta-item {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* Segmented progress bar */
.lead-progress-segments {
  display: flex;
  gap: 3px;
  margin: 4px 12px 8px;
  height: 4px;
}

.lead-progress-segments .seg {
  flex: 1;
  background: var(--p-gray-4);
  border-radius: 2px;
}

.lead-progress-segments .seg.done                             { background: var(--p-primary); }
.lead-card[data-pipenew="true"] .seg.done,
.lead-card[data-urgent="true"] .seg.done                      { background: var(--p-red); }

/* Progress row with step counter */
.lead-progress-row {
  padding: 0 12px 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.lead-progress-row .lead-progress {
  flex: 1;
  margin: 0;
}

.lead-progress-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--p-gray-3);
  white-space: nowrap;
  min-width: 26px;
  text-align: right;
}

/* Card action row */
.lead-card-actions {
  padding: 0 12px 12px;
  display: flex;
  gap: 8px;
}

.btn-call {
  flex: 1;
  padding: 9px 0;
  background: #ecfdf5;
  color: var(--p-green);
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  flex: 1;
  padding: 9px 0;
  background: var(--p-primary);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

.btn-mail {
  flex: 1;
  padding: 9px 0;
  background: #ecfdf5;
  color: var(--p-green);
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  -webkit-tap-highlight-color: transparent;
}

.btn-danger {
  flex: 1;
  padding: 9px 0;
  background: #fef2f2;
  color: var(--p-red);
  border: 1px solid #fecaca;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Status Badges ---- */

.p-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.p-badge-neu          { background: #fee2e2; color: #991b1b; }
.p-badge-kein_anruf   { background: #fee2e2; color: #991b1b; }
.p-badge-in_bearbeitung { background: #dbeafe; color: #1d4ed8; }
.p-badge-termin       { background: #dbeafe; color: #1d4ed8; }
.p-badge-angebot      { background: #fef3c7; color: #92400e; }
.p-badge-auftrag      { background: #dcfce7; color: #166534; }
.p-badge-abgeschlossen { background: #d1fae5; color: #065f46; }

.p-badge-step {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: .03em;
  background: #f0f0f0;
  color: #555;
}

/* ---- Bottom Navigation ---- */

.portal-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  height: var(--p-nav-h);
  background: #ffffff;
  border-top: 1px solid var(--p-gray-4);
  display: flex;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.07);
}

.portal-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--p-gray-3);
  font-size: 10px;
  font-weight: 500;
  padding: 8px 4px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s;
}

.portal-nav-item.active {
  color: var(--p-primary);
}

/* ---- Section title ---- */

.portal-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--p-gray-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 8px 2px;
}

.portal-section-title:first-child {
  margin-top: 0;
}

/* ---- Empty state ---- */

.portal-empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--p-gray-3);
  font-size: 14px;
}

.portal-empty p {
  margin-top: 12px;
}

/* ---- Portal forms (light background) ---- */

.portal-form-group {
  margin-bottom: 12px;
}

.portal-form-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--p-gray-3);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.portal-form-input {
  width: 100%;
  padding: 12px 14px;
  background: var(--p-gray-5);
  border: 1px solid var(--p-gray-4);
  border-radius: 10px;
  font-size: 15px;
  color: var(--p-gray-1);
  outline: none;
  transition: border-color 0.15s;
}

.portal-form-input:focus {
  border-color: var(--p-primary);
  background: #ffffff;
}

.portal-form-input.error {
  border-color: var(--p-red);
}

.portal-form-field-error {
  font-size: 12px;
  color: var(--p-red);
  margin-top: 4px;
}

.portal-form-hint {
  font-size: 11px;
  color: var(--p-gray-3);
  margin-top: 4px;
  line-height: 1.4;
}

.portal-form-error {
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  color: #991b1b;
  margin-bottom: 12px;
}

/* ---- Lead Detail ---- */

.detail-header {
  background: var(--p-header);
  color: #ffffff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.detail-back {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

.detail-header-info {
  flex: 1;
  min-width: 0;
}

.detail-header-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.detail-header-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
}

.detail-main {
  padding: 12px 12px calc(var(--p-nav-h) + 8px);
}

/* Info card */
.detail-card {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  margin-bottom: 10px;
  overflow: hidden;
}

.detail-card-head {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--p-gray-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.detail-card-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--p-gray-5);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 0;
  border-bottom: 1px solid var(--p-gray-5);
  font-size: 13px;
  gap: 12px;
}

.detail-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.detail-label {
  color: var(--p-gray-3);
  flex-shrink: 0;
}

.detail-value {
  font-weight: 500;
  color: var(--p-gray-1);
  text-align: right;
  word-break: break-word;
}

.detail-value a {
  color: var(--p-primary);
  text-decoration: none;
}

/* Pipeline */
.pipeline-step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--p-gray-5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pipeline-step:last-child {
  border-bottom: none;
}

.pipeline-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--p-gray-4);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}

.pipeline-check.done {
  background: var(--p-green);
  border-color: var(--p-green);
}

.pipeline-step-label {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--p-gray-2);
}

.pipeline-step-label.done {
  color: var(--p-gray-3);
  text-decoration: line-through;
}

.pipeline-step-date {
  font-size: 11px;
  color: var(--p-gray-3);
}

/* Contact button large */
.btn-contact-large {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px;
  background: #ecfdf5;
  color: var(--p-green);
  border: 1px solid #a7f3d0;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-bottom: 8px;
  -webkit-tap-highlight-color: transparent;
}

/* Status change row */
.status-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.status-btn {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  background: var(--p-gray-5);
  color: var(--p-gray-2);
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.status-btn.current {
  background: var(--p-primary);
  color: #ffffff;
  border-color: var(--p-primary);
}

.status-btn.danger {
  background: #fef2f2;
  color: var(--p-red);
  border-color: #fecaca;
}

/* ---- Abrechnung ---- */

.invoice-card {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 14px;
  margin-bottom: 10px;
}

.invoice-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.invoice-period {
  font-size: 15px;
  font-weight: 700;
}

.invoice-total {
  font-size: 18px;
  font-weight: 800;
}

.invoice-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--p-gray-3);
  padding: 3px 0;
}

.invoice-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 4px;
}

.invoice-badge-offen      { background: #fef3c7; color: #92400e; }
.invoice-badge-bezahlt    { background: #dcfce7; color: #166534; }
.invoice-badge-ueberfaellig { background: #fee2e2; color: #991b1b; }

.invoice-empty {
  background: var(--p-card);
  border-radius: var(--p-radius);
  padding: 24px;
  text-align: center;
  color: var(--p-gray-3);
  font-size: 13px;
}

/* ---- Profil ---- */

.profil-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--p-primary);
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.profil-card {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  overflow: hidden;
  margin-bottom: 10px;
}

.profil-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--p-gray-5);
  font-size: 13px;
  gap: 12px;
}

.profil-row:last-child {
  border-bottom: none;
}

.profil-label {
  color: var(--p-gray-3);
  flex-shrink: 0;
}

.profil-value {
  font-weight: 500;
  text-align: right;
  word-break: break-word;
}

.btn-logout {
  display: block;
  width: 100%;
  padding: 13px;
  background: #fef2f2;
  color: var(--p-red);
  border: 1px solid #fecaca;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  margin-top: 16px;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Login page ---- */

.portal-login-shell {
  max-width: 430px;
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.portal-login-logo {
  height: 44px;
  width: auto;
  margin-bottom: 24px;
}

.portal-login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--p-gray-1);
  margin-bottom: 32px;
  text-align: center;
}

.portal-login-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.portal-login-input {
  width: 100%;
  padding: 14px 16px;
  background: var(--p-gray-5);
  border: 1px solid var(--p-gray-4);
  border-radius: 10px;
  color: var(--p-gray-1);
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}

.portal-login-input::placeholder {
  color: var(--p-gray-3);
}

.portal-login-input:focus {
  border-color: var(--p-primary);
  background: #ffffff;
}

.portal-login-btn {
  width: 100%;
  padding: 14px;
  background: var(--p-primary);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  -webkit-tap-highlight-color: transparent;
}

.portal-login-error {
  background: var(--p-gray-5);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--p-red);
  font-size: 13px;
  text-align: center;
}

/* ============================================================
   Lead Detail — Redesign (Mockup-orientiert)
   ============================================================ */

/* Header Topbar (Zurück + Badge) */
.det-topbar {
  background: #ffffff;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--p-gray-4);
}

.det-back {
  color: var(--p-gray-3);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.det-edit-btn {
  color: var(--p-header);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.det-lead-body {
  padding: 14px 16px 16px;
}

.det-lead-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--p-gray-1);
  line-height: 1.2;
}

.det-lead-sub {
  font-size: 0.72rem;
  color: var(--p-gray-3);
  margin: 3px 0 14px;
}

.det-call-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  background: var(--p-primary);
  color: #ffffff;
  border-radius: 8px;
  padding: 13px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}

.det-mail-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 1;
  background: #ecfdf5;
  color: var(--p-green);
  border: 1.5px solid #bbf7d0;
  border-radius: 8px;
  padding: 13px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

/* Extra bottom padding for save bar */
.det-content-wrap {
  padding-bottom: 60px;
}

/* === Kundeninformationen Accordion === */

details.det-accordion {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  margin-bottom: 12px;
  overflow: hidden;
}

details.det-accordion > summary {
  list-style: none;
  cursor: pointer;
  background: #e6f4ec;
  color: var(--p-header);
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

details.det-accordion > summary::-webkit-details-marker { display: none; }

.det-acc-arrow {
  transition: transform 0.2s;
  flex-shrink: 0;
}

details.det-accordion[open] > summary .det-acc-arrow {
  transform: rotate(180deg);
}

.det-acc-body {
  padding: 0 14px 14px;
}

.info-sec-hdr {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--p-header);
  background: #e6f4ec;
  margin: 12px -14px 8px;
  padding: 5px 14px;
}

.info-sec-hdr:first-child {
  margin-top: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.info-cell {
  padding: 7px 6px 7px 0;
  border-bottom: 1px solid var(--p-gray-5);
  min-width: 0;
}

.info-cell:nth-last-child(-n+2) {
  border-bottom: none;
}

.info-cell-full {
  grid-column: 1 / -1;
}

.info-lbl {
  font-size: 10px;
  color: var(--p-gray-3);
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.info-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--p-gray-1);
  word-break: break-word;
}

.info-val a {
  color: var(--p-header);
  text-decoration: none;
}

.info-msg {
  padding: 10px 0 0;
  font-size: 0.8rem;
  color: var(--p-gray-2);
  font-style: italic;
  line-height: 1.6;
  border-left: 3px solid var(--p-header);
  padding-left: 10px;
  margin-top: 8px;
}

/* === Pipeline section === */

.pip-section-hdr {
  font-size: 11px;
  font-weight: 700;
  color: var(--p-gray-3);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin: 16px 0 8px 2px;
}

.pip-item {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  margin-bottom: 6px;
  overflow: hidden;
}
.pip-item.pip-done { background: #f5f6f7; box-shadow: none; }

.pip-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px 11px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.pip-toggle-form {
  flex-shrink: 0;
  margin: 0;
  display: flex;
  margin-top: 2px;
}

/* Numbered circle */
.pip-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--p-gray-4);
  background: none;
  color: var(--p-gray-3);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.pip-num.pn-done {
  background: var(--p-green);
  border-color: var(--p-green);
  color: #ffffff;
}

.pip-num.pn-active {
  border-color: var(--p-header);
  color: var(--p-header);
}

.pip-head-info {
  flex: 1;
  min-width: 0;
}

.pip-step-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--p-gray-1);
}

.pip-step-label.done {
  color: var(--p-gray-3);
  text-decoration: line-through;
}

.pip-step-sub {
  font-size: 11px;
  color: var(--p-gray-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pip-step-sub.done {
  color: var(--p-green);
}

.pip-chevron {
  flex-shrink: 0;
  transition: transform 0.2s;
  color: var(--p-gray-4);
  margin-top: 4px;
}

.pip-item.open .pip-chevron {
  transform: rotate(180deg);
}

/* Pipeline body (expandable) */
.pip-body {
  border-top: 1px solid var(--p-gray-5);
  padding: 12px 14px;
}

.pip-field-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--p-gray-3);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 6px;
}

.pip-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 14px;
  color: var(--p-gray-1);
  background: var(--p-gray-5);
  outline: none;
  margin-bottom: 8px;
}

.pip-input:focus {
  border-color: var(--p-header);
  background: #fff;
}

.pip-notes-history {
  background: var(--p-gray-5);
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  padding: 4px 12px;
  margin-bottom: 8px;
}
.pip-note-entry {
  padding: 8px 0;
  border-bottom: 1px solid var(--p-gray-4);
}
.pip-note-entry:last-child { border-bottom: none; }
.pip-note-ts {
  font-size: 10px;
  font-weight: 700;
  color: var(--p-gray-3);
  letter-spacing: 0.03em;
  margin-bottom: 3px;
}
.pip-note-text {
  font-size: 12px;
  color: var(--p-gray-1);
  line-height: 1.6;
  word-break: break-word;
}

.pip-notes-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 13px;
  color: var(--p-gray-1);
  background: var(--p-gray-5);
  outline: none;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
  margin-bottom: 8px;
}

.pip-notes-input:focus {
  border-color: var(--p-header);
  background: #fff;
}

.pip-tog-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.pip-tog {
  flex: 1;
  padding: 9px 0;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: var(--p-gray-5);
  color: var(--p-gray-2);
  -webkit-tap-highlight-color: transparent;
}

.pip-tog.tog-yes {
  background: #dcfce7;
  border-color: #86efac;
  color: #166534;
}

.pip-tog.tog-no {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}

.pip-save-btn {
  display: block;
  width: 100%;
  padding: 10px;
  background: var(--p-header);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.pip-service-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.pip-service-form {
  flex: 1;
  margin: 0;
}

.pip-service-btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 10px 0 9px;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  cursor: pointer;
  background: var(--p-gray-5);
  color: var(--p-gray-1);
  -webkit-tap-highlight-color: transparent;
}

.pip-service-btn:active {
  background: var(--p-gray-4);
}

.pip-service-btn-title {
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.pip-service-btn-price {
  font-size: 11px;
  font-weight: 600;
  color: var(--p-gray-3);
}

.pip-service-btn--booked,
.pip-service-btn:disabled {
  border-color: #86efac;
  background: #dcfce7;
  color: #166534;
  cursor: default;
}

.pip-service-btn--booked .pip-service-btn-price,
.pip-service-btn:disabled .pip-service-btn-price {
  color: #166534;
}

/* === Sticky Save Bar === */

.det-save-bar {
  position: fixed;
  bottom: var(--p-nav-h);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border-top: 1px solid var(--p-gray-4);
  padding: 9px 12px 12px;
  display: flex;
  gap: 8px;
  z-index: 150;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
}

.det-save-btn {
  flex: 1;
  padding: 11px 0;
  background: var(--p-header);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  -webkit-tap-highlight-color: transparent;
}

.det-vl-btn {
  padding: 11px 16px;
  background: none;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--p-red);
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ── Company Contact Bar ────────────────────── */

.company-contact-bar {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  background: #f8faf9;
  border-bottom: 1px solid var(--p-gray-4);
  border-radius: 14px;
}

.company-contact-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 0;
  background: #ffffff;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p-gray-2);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Filter Bar ─────────────────────────────── */

.portal-filter-bar {
  display: flex;
  background: #ffffff;
  border-bottom: 1px solid var(--p-gray-4);
}

.filter-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 8px 10px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  cursor: pointer;
  transition: border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.filter-num {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1;
  color: var(--p-gray-2);
  transition: color 0.15s;
}

.filter-lbl {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--p-gray-3);
  margin-top: 3px;
}

.filter-btn.active .filter-num {
  color: var(--p-primary);
}

.filter-btn.active {
  border-bottom-color: var(--p-primary);
}

.filter-divider {
  width: 1px;
  background: var(--p-gray-4);
  margin: 10px 0;
}

/* ── Bell button (header) ───────────────────── */

.portal-bell {
  position: relative;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--p-gray-5);
  color: var(--p-gray-2);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.portal-bell--urgent {
  color: var(--p-primary);
}

.portal-bell.bell-active {
  background: var(--p-primary);
  color: #ffffff;
}

.portal-bell-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  background: var(--p-red);
  color: #ffffff;
  border-radius: 8px;
  font-size: 0.625rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* ── Card bell indicator ────────────────────── */

.lead-card-bell {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--p-red);
  background: #fde8e8;
  border-bottom: 1px solid #f8c5c5;
}

/* ── Comments ───────────────────────────────── */

.comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}

.comment-item {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 10px 14px;
}

.comment-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 5px;
}

.comment-author {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--p-header);
}

.comment-time {
  font-size: 0.68rem;
  color: var(--p-gray-3);
}

.comment-text {
  font-size: 0.85rem;
  color: var(--p-gray-1);
  line-height: 1.5;
}

.comment-delete-btn {
  background: none;
  border: none;
  color: var(--p-gray-4);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}
.comment-delete-btn:hover { color: var(--p-red); }

.comment-empty {
  font-size: 0.8rem;
  color: var(--p-gray-3);
  text-align: center;
  padding: 16px 0;
  margin-bottom: 12px;
}

.comment-form {
  display: flex;
  flex-direction: column;
}

.comment-submit-btn {
  align-self: flex-end;
  padding: 9px 18px;
  background: var(--p-header);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Lead Edit Form ─────────────────────────── */

.edit-section {
  padding: 16px 16px 4px;
  border-bottom: 1px solid var(--p-gray-4);
}

.edit-section-title {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--p-gray-3);
  margin-bottom: 12px;
}

.edit-field {
  margin-bottom: 12px;
}

.edit-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--p-gray-2);
  margin-bottom: 4px;
}

.edit-row {
  display: flex;
  gap: 10px;
}

.edit-error {
  font-size: 0.72rem;
  color: var(--p-red);
  margin-top: 3px;
}

.p-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 14px;
  color: var(--p-gray-1);
  background: var(--p-gray-5);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  -webkit-appearance: none;
}

.p-input:focus {
  border-color: var(--p-header);
  background: #fff;
}

.p-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 14px;
  color: var(--p-gray-1);
  background: var(--p-gray-5);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.p-select:focus {
  border-color: var(--p-header);
  background-color: #fff;
}

.p-textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 14px;
  color: var(--p-gray-1);
  background: var(--p-gray-5);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  resize: vertical;
  line-height: 1.5;
}

.p-textarea:focus {
  border-color: var(--p-header);
  background: #fff;
}

.edit-save-bar {
  position: fixed;
  bottom: var(--p-nav-h);
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 430px;
  background: #ffffff;
  border-top: 1px solid var(--p-gray-4);
  padding: 9px 16px 12px;
  display: flex;
  gap: 10px;
  z-index: 150;
  box-shadow: 0 -2px 16px rgba(0,0,0,0.08);
}

.edit-save-btn {
  flex: 1;
  padding: 12px 0;
  background: var(--p-header);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.edit-cancel-btn {
  padding: 12px 20px;
  background: none;
  border: 1px solid var(--p-gray-4);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--p-gray-2);
  text-decoration: none;
  display: flex;
  align-items: center;
  -webkit-tap-highlight-color: transparent;
}


/* =========================================================
   LEAD DETAIL – MOBILE REDESIGN
   ========================================================= */

  :root {
      --det-green: #006E3A;
      --det-green-dark: #00562e;
      --det-green-soft: #eef7f2;

      --det-text: #17201b;
      --det-text-soft: #68716c;

      --det-border: #e4e8e5;
      --det-bg: #f5f7f6;
      --det-white: #ffffff;

      --det-radius: 14px;
      --det-shadow:
          0 1px 2px rgba(0, 0, 0, 0.03),
          0 4px 16px rgba(0, 0, 0, 0.035);
  }


  /* -----------------------------------------------------
      SEITENHINTERGRUND
      ----------------------------------------------------- */

  body {
      background: var(--det-bg);
  }

  .det-content-wrap {
      padding: 14px 12px 8px;
      max-width: 100%;
  }


  /* -----------------------------------------------------
      TOPBAR
      ----------------------------------------------------- */

  .det-topbar {
      min-height: 46px;
      padding: 0 14px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #edf0ee;
  }

  .det-back,
  .det-edit-btn {
      min-height: 34px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 0.78rem;
      font-weight: 650;
      text-decoration: none;
  }

  .det-back {
      color: #4f5953;
  }

  .det-edit-btn {
      padding: 6px 10px;
      border: 1px solid var(--det-border);
      border-radius: 8px;
      color: #333b36;
      background: #fff;
  }


  /* -----------------------------------------------------
      LEAD HEADER
      ----------------------------------------------------- */

  .det-lead-body {
      padding: 18px 14px 16px;
  }

  .det-lead-name {
      margin: 0 0 5px;
      color: var(--det-text);
      font-size: 1.32rem;
      font-weight: 750;
      line-height: 1.2;
      letter-spacing: -0.02em;
  }

  .det-lead-sub {
      margin-bottom: 16px;
      color: var(--det-text-soft);
      font-size: 0.76rem;
      line-height: 1.45;
  }

  .det-lead-body > div:last-child {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) auto;
      gap: 8px !important;
  }


  /* Telefon */

  .det-call-btn {
      min-height: 43px;
      padding: 0 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;

      border-radius: 10px;

      background: var(--det-green);
      color: #fff;

      font-size: 0.86rem;
      font-weight: 700;
      text-decoration: none;

      box-shadow: none;
  }

  .det-call-btn:active {
      background: var(--det-green-dark);
  }


  /* Mail */

  .det-mail-btn {
      min-width: 72px;
      min-height: 43px;
      padding: 0 13px;

      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;

      border: 1px solid var(--det-border);
      border-radius: 10px;

      background: #fff;
      color: #3b443f;

      font-size: 0.82rem;
      font-weight: 650;
      text-decoration: none;
  }


  /* -----------------------------------------------------
      KUNDENINFORMATIONEN
      ----------------------------------------------------- */

  .det-accordion {
      margin: 0 0 18px;
      overflow: hidden;

      border: 1px solid var(--det-border);
      border-radius: var(--det-radius);

      background: var(--det-white);
      box-shadow: var(--det-shadow);
  }

  .det-acc-trigger {
      min-height: 51px;
      padding: 0 14px;

      display: flex;
      align-items: center;
      justify-content: space-between;

      color: var(--det-text);
      font-size: 0.86rem;
      font-weight: 700;

      cursor: pointer;
      list-style: none;
  }

  .det-acc-trigger::-webkit-details-marker {
      display: none;
  }

  .det-acc-trigger > div {
      gap: 9px !important;
  }

  .det-acc-trigger > div > svg {
      color: var(--det-green);
  }

  .det-acc-arrow {
      color: #8b928e;
      transition: transform .18s ease;
  }

  .det-accordion[open] .det-acc-arrow {
      transform: rotate(180deg);
  }

  .det-acc-body {
      padding: 0 14px 15px;
      border-top: 1px solid #edf0ee;
  }


  /* -----------------------------------------------------
      ABSCHNITTSÜBERSCHRIFTEN
      ----------------------------------------------------- */

  .info-sec-hdr {
      margin: 18px 0 5px;
      padding: 0;

      color: #8a918d;

      font-size: 0.65rem;
      line-height: 1;
      font-weight: 750;

      letter-spacing: 0.07em;
      text-transform: uppercase;
  }

  .info-sec-hdr:first-child {
      margin-top: 15px;
  }


  /* -----------------------------------------------------
      INFORMATIONSGRID

      Statt vieler kleiner Karten:
      ruhige Tabellen-/CRM-Darstellung
      ----------------------------------------------------- */

  .info-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 0;
  }

  .info-cell {
      min-width: 0;
      padding: 11px 4px 11px 0;

      border: 0;
      border-bottom: 1px solid #edf0ee;

      background: transparent;
      border-radius: 0;
  }

  .info-cell:nth-child(even):not(.info-cell-full) {
      padding-left: 12px;
  }

  .info-cell-full {
      grid-column: 1 / -1;
  }

  .info-lbl {
      margin-bottom: 3px;

      color: #8a918d;

      font-size: 0.67rem;
      line-height: 1.2;
      font-weight: 550;
  }

  .info-val {
      min-width: 0;

      color: #212924;

      font-size: 0.82rem;
      line-height: 1.4;
      font-weight: 650;

      word-break: break-word;
  }

  .info-val a {
      color: var(--det-green);
      text-decoration: none;
  }


  /* Kundennachricht */

  .info-msg {
      margin-top: 8px;
      padding: 12px 13px;

      border: 0;
      border-left: 3px solid #b7d6c6;
      border-radius: 0 9px 9px 0;

      background: #f7f9f8;
      color: #414a45;

      font-size: 0.8rem;
      line-height: 1.5;
      font-style: normal;
  }


  /* -----------------------------------------------------
      PIPELINE ÜBERSCHRIFT
      ----------------------------------------------------- */

  .pip-section-hdr {
      margin: 20px 2px 9px;
      padding: 0;

      color: #737c77;

      font-size: 0.7rem;
      font-weight: 750;

      letter-spacing: 0.045em;
      text-transform: uppercase;
  }


  /* -----------------------------------------------------
      PIPELINE KARTEN
      ----------------------------------------------------- */

  .pip-item {
      margin-bottom: 8px;

      overflow: hidden;

      border: 1px solid var(--det-border);
      border-radius: 12px;

      background: #fff;
      box-shadow: 0 1px 3px rgba(0,0,0,.025);
  }

  .pip-item.pip-done {
      border-color: #dceae3;
      background: #fbfdfc;
  }


  /* Pipeline Header */

  .pip-head {
      min-height: 59px;
      padding: 9px 12px;

      display: flex;
      align-items: center;
      gap: 11px;

      cursor: pointer;
  }


  /* Nummer */

  .pip-toggle-form {
      flex: 0 0 auto;
  }

  .pip-num {
      width: 31px;
      height: 31px;
      padding: 0;

      display: flex;
      align-items: center;
      justify-content: center;

      border: 1px solid #dce1de;
      border-radius: 50%;

      background: #fff;
      color: #606863;

      font-size: 0.74rem;
      font-weight: 750;
  }

  .pip-num.pn-done {
      border-color: var(--det-green);
      background: var(--det-green);
      color: #fff;
  }


  /* Text */

  .pip-head-info {
      min-width: 0;
      flex: 1;
  }

  .pip-step-label {
      margin-bottom: 2px;

      color: #202823;

      font-size: 0.84rem;
      line-height: 1.25;
      font-weight: 680;
  }

  .pip-step-label.done {
      color: #57615b;
  }

  .pip-step-sub {
      overflow: hidden;

      color: #939a96;

      font-size: 0.69rem;
      line-height: 1.25;

      white-space: nowrap;
      text-overflow: ellipsis;
  }

  .pip-step-sub.done {
      color: var(--det-green);
  }

  .pip-chevron {
      flex: 0 0 auto;
      color: #a1a7a3;

      transition: transform .18s ease;
  }

  .pip-item.open .pip-chevron {
      transform: rotate(180deg);
  }


  /* -----------------------------------------------------
      PIPELINE GEÖFFNETER INHALT
      ----------------------------------------------------- */

  .pip-body {
      padding: 13px 12px 14px;

      border-top: 1px solid #edf0ee;

      background: #fafbfa;
  }

  .pip-field-label {
      margin: 0 0 6px;

      color: #69716c;

      font-size: 0.71rem;
      font-weight: 650;
  }

  .pip-input,
  .pip-notes-input {
      box-sizing: border-box;
      width: 100%;
      min-height: 42px;

      padding: 9px 10px;

      border: 1px solid #dfe4e1;
      border-radius: 9px;
      outline: none;

      background: #fff;
      color: #222a25;

      font: inherit;
      font-size: 0.82rem;
  }

  .pip-notes-input {
      resize: vertical;
      line-height: 1.45;
  }

  .pip-input:focus,
  .pip-notes-input:focus {
      border-color: #85b69e;
      box-shadow: 0 0 0 3px rgba(0, 110, 58, .07);
  }


  /* Speichern */

  .pip-save-btn {
      min-height: 38px;
      margin-top: 8px;
      padding: 0 14px;

      border: 0;
      border-radius: 8px;

      background: var(--det-green);
      color: #fff;

      font-size: 0.77rem;
      font-weight: 700;
  }


  /* -----------------------------------------------------
      JA / NEIN
      ----------------------------------------------------- */

  .pip-tog-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
  }

  .pip-tog {
      min-height: 42px;

      border: 1px solid var(--det-border);
      border-radius: 9px;

      background: #fff;
      color: #4e5752;

      font-size: 0.77rem;
      font-weight: 650;
  }

  .pip-tog.tog-yes {
      border-color: #acd1bd;
      background: var(--det-green-soft);
      color: var(--det-green);
  }

  .pip-tog.tog-no {
      border-color: #e6caca;
      background: #fffafa;
      color: #9d4545;
  }


  /* -----------------------------------------------------
      HLB / HA
      ----------------------------------------------------- */

  .pip-service-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;

      margin-top: 12px;
  }

  .pip-service-form {
      width: 100%;
  }

  .pip-service-btn {
      width: 100%;
      min-height: 54px;

      padding: 9px 10px;

      display: flex;
      flex-direction: column;
      align-items: flex-start;
      justify-content: center;

      border: 1px solid #dce2de;
      border-radius: 10px;

      background: #fff;
      color: #29312c;

      text-align: left;
  }

  .pip-service-btn-title {
      display: flex;
      align-items: center;
      gap: 5px;

      font-size: 0.77rem;
      font-weight: 700;
  }

  .pip-service-btn-price {
      margin-top: 2px;

      color: #89908c;

      font-size: 0.68rem;
      font-weight: 550;
  }

  .pip-service-btn--booked {
      border-color: #b8d8c7;
      background: var(--det-green-soft);
      color: var(--det-green);
  }


  /* -----------------------------------------------------
      NOTIZEN
      ----------------------------------------------------- */

  .pip-notes-history {
      margin-bottom: 10px;
  }

  .pip-note-entry {
      padding: 9px 0;

      border-bottom: 1px solid #eaeeeb;
  }

  .pip-note-ts {
      margin-bottom: 3px;

      color: #9aa09c;

      font-size: 0.64rem;
  }

  .pip-note-text {
      color: #343c37;

      font-size: 0.78rem;
      line-height: 1.45;
  }


  /* -----------------------------------------------------
      KOMMENTARE
      ----------------------------------------------------- */

  .comment-list {
      overflow: hidden;

      border: 1px solid var(--det-border);
      border-radius: 12px;

      background: #fff;
  }

  .comment-item {
      padding: 12px 13px;

      border: 0;
      border-bottom: 1px solid #edf0ee;

      background: transparent;
  }

  .comment-item:last-child {
      border-bottom: 0;
  }

  .comment-meta {
      margin-bottom: 6px;

      display: flex;
      align-items: center;
      justify-content: space-between;
  }

  .comment-time {
      color: #969d99;

      font-size: 0.65rem;
      font-weight: 550;
  }

  .comment-delete-btn {
      width: 27px;
      height: 27px;

      border: 0;
      border-radius: 6px;

      background: transparent;
      color: #adb2af;

      font-size: 0.7rem;
  }

  .comment-text {
      color: #313934;

      font-size: 0.8rem;
      line-height: 1.5;
  }

  .comment-empty {
      padding: 20px;

      border: 1px dashed #dce1de;
      border-radius: 11px;

      color: #9aa19d;

      font-size: 0.75rem;
      text-align: center;
  }

  .comment-form {
      margin-top: 9px;
  }

  .comment-submit-btn {
      min-height: 40px;
      padding: 0 14px;

      border: 0;
      border-radius: 9px;

      background: var(--det-green);
      color: #fff;

      font-size: 0.78rem;
      font-weight: 700;
  }


  /* -----------------------------------------------------
      VERLOREN
      bewusst nicht als großer roter CTA
      ----------------------------------------------------- */

  .det-vl-btn {
      min-height: 41px !important;

      border: 1px solid #e6d5d5 !important;
      border-radius: 9px !important;

      background: transparent !important;
      color: #a15d5d !important;

      font-size: 0.73rem !important;
      font-weight: 600 !important;
  }

  /* =========================================================
   FEINSCHLIFF NACH FEEDBACK
   ========================================================= */

/* ---------------------------------------------------------
   1) Erledigte Status-Felder wieder grauer wie vorher
   --------------------------------------------------------- */
.pip-item.pip-done {
  background: #f5f6f7;
  box-shadow: none;
}

.pip-step-label.done {
  color: var(--p-gray-3);
  text-decoration: line-through;
}

.pip-step-sub.done {
  color: var(--p-gray-3);
}

/* ---------------------------------------------------------
   2) Status-Schrift wieder wie vorher, also nicht so fett
   --------------------------------------------------------- */
.pip-step-label {
  font-size: 14px;
  font-weight: 500;
}

.pip-step-sub {
  font-size: 11px;
  font-weight: 400;
  color: var(--p-gray-3);
}

.pip-field-label {
  font-size: 11px;
  font-weight: 700;
}

/* ---------------------------------------------------------
   3) Buttons bei Schritt 4 schöner / sauber zentriert
   --------------------------------------------------------- */
.pip-tog-row,
.pip-service-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.pip-tog {
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
}

.pip-service-form {
  margin: 0;
}

.pip-service-btn {
  width: 100%;
  min-height: 54px;
  padding: 10px 12px;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;      /* wichtig: mittig */
  justify-content: center;  /* wichtig: mittig */
  text-align: center;
  background: #ffffff;
}

.pip-service-btn-title {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

.pip-service-btn-price {
  width: 100%;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--p-gray-3);
  text-align: center;
}

.pip-service-btn--booked,
.pip-service-btn:disabled {
  background: #eef4f0;
  border-color: #cfd8d3;
  color: var(--p-gray-1);
}

.pip-service-btn--booked .pip-service-btn-price,
.pip-service-btn:disabled .pip-service-btn-price {
  color: var(--p-gray-2);
}

/* ---------------------------------------------------------
   4) Telefon- und Mail-Button schlanker machen
   --------------------------------------------------------- */
.det-lead-body > div:last-child {
  display: flex !important;
  gap: 8px !important;
  flex-wrap: wrap;
  align-items: center;
}

.det-call-btn,
.det-mail-btn {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 650;
}

.det-call-btn {
  gap: 6px;
}

.det-mail-btn {
  gap: 6px;
  padding: 9px 11px;
}

/* ---------------------------------------------------------
   5) Kommentare wieder getrennt wie vorher
   --------------------------------------------------------- */
.comment-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  border: none;
  background: transparent;
  border-radius: 0;
}

.comment-item {
  background: var(--p-card);
  border-radius: var(--p-radius);
  box-shadow: var(--p-shadow);
  padding: 10px 14px;
  border: none;
}

.comment-item:last-child {
  border-bottom: none;
}

.comment-meta {
  margin-bottom: 5px;
}

.comment-text {
  font-size: 0.85rem;
  color: var(--p-gray-1);
  line-height: 1.5;
}

/* =========================================================
   KUNDENINFORMATIONEN – eleganter / ruhiger / weniger fett
   ========================================================= */

/* Gesamte Accordion-Karte etwas feiner */
details.det-accordion {
  background: #ffffff;
  border: 1px solid #e3e8e4;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

/* Kopf der Karte */
details.det-accordion > summary {
  background: #f7faf8;
  color: var(--p-gray-1);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
  font-weight: 650;
  border-bottom: 1px solid #edf1ee;
}

details.det-accordion[open] > summary {
  background: #f7faf8;
}

details.det-accordion > summary svg {
  color: var(--p-header);
}

.det-acc-body {
  padding: 8px 16px 16px;
}


/* ---------------------------------------------------------
   Abschnittsheader: Kontakt / Immobilie / Aktuelle Heizung
   statt grüner Balken -> ruhige, hochwertige Trenner
   --------------------------------------------------------- */
.info-sec-hdr {
  display: flex;
  align-items: center;
  gap: 10px;

  margin: 18px 0 10px;
  padding: 0;

  background: transparent;
  color: #74807a;

  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.info-sec-hdr::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e7ece8;
}

.info-sec-hdr:first-child {
  margin-top: 12px;
}


/* ---------------------------------------------------------
   Grid / Felder
   --------------------------------------------------------- */
.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 18px;
  row-gap: 0;
}

.info-cell {
  min-width: 0;
  padding: 10px 0 11px;
  border-bottom: 1px solid #edf1ee;
}

.info-cell-full {
  grid-column: 1 / -1;
}


/* Labels dezenter */
.info-lbl {
  margin-bottom: 4px;

  color: #8a938d;

  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-transform: none;
  line-height: 1.25;
}

/* Werte deutlich ruhiger */
.info-val {
  color: #1f2823;

  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.35;
  word-break: break-word;
}

/* Links nicht extra fett / nicht zu knallig */
.info-val a {
  color: #1f2823;
  text-decoration: none;
  font-weight: 500;
}

.info-val a:hover {
  color: var(--p-header);
}


/* Nachricht des Kunden etwas hochwertiger */
.info-msg {
  margin-top: 8px;
  padding: 12px 14px;

  background: #f7f9f8;
  border-left: 3px solid #cfe0d6;
  border-radius: 0 10px 10px 0;

  color: #46504a;
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.55;
}


/* ---------------------------------------------------------
   Mobile Feinheit: bei sehr schmaler Breite mehr Luft
   --------------------------------------------------------- */
@media (max-width: 380px) {
  .info-grid {
    column-gap: 12px;
  }

  .info-val {
    font-size: 0.9rem;
  }
}

/* =========================================================
   KUNDENINFORMATIONEN – KOMPAKT & EINHEITLICH
   ========================================================= */

/* Zwei Spalten sauber und identisch */
.det-acc-body .info-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    column-gap: 18px;
    row-gap: 0;
}


/* Jedes Feld identisch */
.det-acc-body .info-cell {
    min-width: 0;

    margin: 0 !important;

    padding: 8px 0 9px !important;

    border-bottom: 1px solid #e7e9e9;

    text-align: left;
}


/* Rechte Spalte ebenfalls exakt ausgerichtet */
.det-acc-body .info-cell:nth-child(even) {
    padding-left: 0 !important;
    padding-right: 0 !important;
}


/* Felder über volle Breite */
.det-acc-body .info-cell-full {
    grid-column: 1 / -1;
}


/* Kleine Feldbezeichnung */
.det-acc-body .info-lbl {
    margin: 0 0 3px !important;
    padding: 0 !important;

    color: var(--p-gray-3);

    font-size: 10px !important;
    font-weight: 400 !important;
    line-height: 1.25;

    text-transform: none;
    letter-spacing: 0;
}


/* Alle Werte gleich groß und gleich schwer */
.det-acc-body .info-val,
.det-acc-body .info-val a {
    margin: 0 !important;
    padding: 0 !important;

    font-size: 0.78rem !important;
    font-weight: 400 !important;
    line-height: 1.35;

    text-align: left;

    word-break: break-word;
}


/* Eingegangen + Erstkontakt:
   keine Sonderabstände, exakt wie Gebäudetyp/Baujahr */
.det-acc-body .info-grid .info-cell {
    transform: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}


/* erste Spalte */
.det-acc-body .info-grid > .info-cell:nth-child(odd):not(.info-cell-full) {
    padding-left: 0 !important;
}


/* zweite Spalte */
.det-acc-body .info-grid > .info-cell:nth-child(even):not(.info-cell-full) {
    padding-left: 0 !important;
}