/* Empfehlungen · Door2Door (door2door.html, assets/door2door.js) */
.d2d { max-width: 1680px; margin: 0 auto; padding: 20px 24px 24px; }
.d2d .area-switch { margin-bottom: 16px; }
.d2d-layout { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 16px; height: calc(100vh - var(--nav-h) - 130px); min-height: 520px; }
.d2d-side { display: flex; flex-direction: column; min-height: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.d2d-search { position: relative; padding: 12px 12px 8px; }
.d2d-search form { display: flex; gap: 6px; }
.d2d-search input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; background: var(--card); }
.d2d-hits { position: absolute; z-index: 600; left: 12px; right: 12px; top: 52px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 6px; }
.d2d-hits button { display: flex; gap: 8px; align-items: center; width: 100%; text-align: left; border: 0; background: none; padding: 8px; border-radius: 6px; font-size: 12.5px; }
.d2d-hits button:hover { background: var(--bg); }
.d2d-hits small { color: var(--muted); }
.d2d-hits p { margin: 6px 8px; }
.d2d-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 4px 12px 10px; }
.d2d-kpis div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.d2d-kpis small { display: block; color: var(--muted); font-size: 11px; }
.d2d-kpis b { font-family: Poppins, sans-serif; font-size: 18px; font-weight: 600; }
.d2d-kpis b.g { color: var(--green); }
.d2d-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 0 12px 10px; font-size: 12px; }
.d2d-filters button { border: 1px solid var(--line); background: var(--card); border-radius: 7px; padding: 5px 10px; font-size: 12px; color: var(--muted); }
.d2d-filters button.active { border-color: var(--ink); background: var(--yellow-soft); color: var(--ink); font-weight: 600; }
.d2d-filters .sep { width: 1px; height: 18px; background: var(--line); }
.d2d-filters label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }
.d2d-filters input { accent-color: var(--yellow-deep); }
.d2d-tabs { display: flex; border-bottom: 1px solid var(--line); padding: 0 8px; overflow-x: auto; }
.d2d-tabs button { border: 0; background: none; padding: 9px 8px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; white-space: nowrap; }
.d2d-tabs button.active { color: var(--text); border-color: var(--yellow); }
.d2d-list { flex: 1; overflow-y: auto; padding: 6px; }
.d2d-row { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0; background: none; padding: 9px 8px; border-radius: 8px; }
.d2d-row:hover { background: var(--bg); }
.d2d-row > span { flex: 1; min-width: 0; }
.d2d-row b { display: block; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.d2d-row small { display: block; color: var(--muted); font-size: 11.5px; }
.d2d-row em { color: var(--green); margin-top: 2px; }
.d2d-row em.priv { color: var(--muted); }
.d2d-row > i, .d2d-legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); flex: none; margin-top: 3px; }
i.cust { background: var(--ink) !important; border-radius: 50% !important; }
i.cust.ref { background: var(--yellow) !important; box-shadow: inset 0 0 0 2px var(--ink); }
.d2d-legend i.dash { background: none; border: 2px dashed var(--muted); }
.d2d-empty { color: var(--muted); font-size: 12.5px; padding: 14px 10px; margin: 0; }

.d2d-mapwrap { position: relative; z-index: 0; isolation: isolate; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; min-height: 0; } /* eigene Ebene: Leaflet-Panes (z-index 400–1000) bleiben unter Dialogen (45) */
#d2d-map { position: absolute; inset: 0; background: #e8e8e3; }
#d2d-map.drawing { cursor: crosshair; }
#d2d-map.drawing .leaflet-interactive { cursor: crosshair; }
.d2d-tools { position: absolute; z-index: 500; top: 12px; left: 12px; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 300px); } /* rechts Platz für Karte/Satellit/Google Maps */
.d2d-tools .btn, .d2d-base button, .d2d-hint .btn { display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 8px rgba(0,0,0,.12); }
.d2d-tools .btn:not(.btn-primary) { background: var(--card); }
.d2d-tools .btn.on { outline: 2px solid var(--ink); outline-offset: 1px; }
.d2d-base { position: absolute; z-index: 500; top: 12px; right: 12px; display: flex; background: var(--card); border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,.12); overflow: hidden; }
.d2d-base button { border: 0; background: none; padding: 7px 11px; font-size: 12px; font-weight: 600; color: var(--muted); box-shadow: none; }
.d2d-base button.active { background: var(--ink); color: #fff; }
.d2d-hint { position: absolute; z-index: 500; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; background: var(--card); border-radius: 10px; padding: 8px 10px 8px 14px; box-shadow: 0 6px 22px rgba(0,0,0,.18); font-size: 12.5px; font-weight: 600; max-width: calc(100% - 24px); }
.d2d-hint[hidden] { display: none; }
.d2d-legend { position: absolute; z-index: 500; left: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 4px 12px; background: rgba(255,255,255,.92); border-radius: 8px; padding: 6px 10px; font-size: 11px; max-width: 60%; }
.d2d-legend span { display: inline-flex; gap: 5px; align-items: center; }
.d2d-legend i { margin: 0; width: 10px; height: 10px; }
.d2d-hint:not([hidden]) ~ .d2d-legend { display: none; }

/* Marker & Popups */
.d2d-pin span { display: grid; place-items: center; width: 22px; height: 22px; margin: 2px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: var(--c); border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); color: #fff; font-size: 11px; }
.d2d-cust span { display: grid; place-items: center; width: 26px; height: 26px; margin: 1px; border-radius: 50%; background: var(--ink); color: #fff; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.d2d-cust.ref span { background: var(--yellow); color: var(--ink); }
.d2d-pop { font: 12.5px/1.45 Inter, system-ui, sans-serif; display: flex; flex-direction: column; gap: 4px; min-width: 220px; }
.d2d-pop b { font-size: 14px; font-family: Poppins, sans-serif; font-weight: 600; }
.d2d-pop p { margin: 2px 0; }
.d2d-pop small { color: var(--muted); }
.d2d-pop .tip { color: var(--yellow-text); font-size: 11.5px; }
.d2d-pop .tag { align-self: flex-start; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 7px; border-radius: 99px; color: #fff; background: var(--c); }
.d2d-pop .acts { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.d2d-pop .acts .btn { display: inline-flex; gap: 4px; align-items: center; }
.leaflet-container a.btn { color: var(--text); }
.leaflet-container a.btn-primary { color: var(--ink); }

/* Dialog Gebiet / Haustür */
#dlg-spot { width: min(560px, calc(100vw - 24px)); }
#dlg-spot .o-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
#dlg-spot .o-field > span { font-weight: 600; font-size: 12px; }
#dlg-spot .o-field i { font-style: normal; font-weight: 400; color: var(--muted); font-size: 11px; }
#dlg-spot :is(input:not([type="checkbox"]):not([type="radio"]), textarea) { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--card); }
#dlg-spot .dialog-foot { flex-wrap: wrap; align-items: center; }
#dlg-spot .dialog-foot .btn { display: inline-flex; gap: 5px; align-items: center; }
.d2d-opts span { gap: 7px; }
.d2d-opts span i { width: 10px; height: 10px; border-radius: 3px; background: var(--c); }

@media (max-width: 900px) {
  .d2d { padding: 12px 12px 20px; }
  .d2d-layout { grid-template-columns: minmax(0, 1fr); height: auto; }
  .d2d-mapwrap { order: -1; height: 68vh; min-height: 420px; }
  .d2d-side { max-height: none; }
  .d2d-list { max-height: 60vh; }
  .d2d-tools .btn { padding: 7px 10px; font-size: 12px; }
  .d2d-base { top: auto; bottom: 12px; right: 56px; }
  .d2d-tools { max-width: calc(100% - 24px); }
  .d2d-legend { display: none; }
  #dlg-spot .dialog-foot .btn { min-height: 44px; }
}

/* Haustür: Termin und Fotos */
.d2d-termin { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 10px; padding: 12px 12px 0; margin: -4px 0 14px; background: var(--yellow-soft); border-radius: 10px; }
.d2d-termin[hidden] { display: none; }
.d2d-termin p { grid-column: 1 / -1; margin: -4px 0 10px; }
#dlg-spot select { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 8px; background: var(--card); }
.d2d-photos { display: flex; flex-wrap: wrap; gap: 8px; }
.d2d-photos:empty { display: none; }
.d2d-photos figure { position: relative; margin: 0; }
.d2d-photos img { width: 76px; height: 76px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; display: block; }
.d2d-photos button { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--ink); color: #fff; font-size: 14px; line-height: 1; }
.d2d-photo-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.d2d-photo-btns .btn { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.d2d-pop .termin { color: var(--yellow-text); font-weight: 600; }
.d2d-pop-photos { display: flex; gap: 5px; flex-wrap: wrap; margin: 4px 0; }
.d2d-pop-photos img { width: 58px; height: 58px; object-fit: cover; border-radius: 6px; cursor: zoom-in; }
.d2d-lightbox { position: fixed; inset: 0; z-index: 2000; background: rgba(0,0,0,.85); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.d2d-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }
.d2d-lightbox .icon-x { position: absolute; top: 14px; right: 14px; color: #fff; background: rgba(255,255,255,.15); border: 0; border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; }
@media (max-width: 520px) { .d2d-termin { grid-template-columns: 1fr 1fr; } }
/* An Kollegen weitergeben */
.d2d-row.for-me { background: var(--yellow-soft); }
.d2d-row small.fwd, .d2d-pop small.fwd { color: var(--yellow-text); font-weight: 600; }
#dlg-fwd { width: min(480px, calc(100vw - 24px)); }
#dlg-fwd .o-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
#dlg-fwd .o-field > span { font-weight: 600; font-size: 12px; }
#dlg-fwd :is(select, textarea) { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--card); }
#dlg-fwd .dialog-foot { align-items: center; }
#dlg-fwd .dialog-foot .btn { display: inline-flex; gap: 6px; align-items: center; }
