/* LeadNetz – Ergänzungen zum gemeinsamen site.css (Gestaltung wie TiPOS Checkliste / CRM / DevBoard). */

.nav-new { min-height: 32px; padding: 4px 12px; font-size: .85rem; color: #fff !important; }
.nav .who { text-decoration: none; color: inherit; }
.nav .net-pick {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; font-weight: 800;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); text-decoration: none; white-space: nowrap;
}
.nav .net-pick:hover { border-color: var(--accent-cyan); }
form.inline { display: inline; }
button.link { background: none; border: 0; color: var(--nav-link); font: inherit; cursor: pointer; padding: 0; min-height: 0; }
button.link:hover { text-decoration: underline; }
button.mini, .button.mini { min-height: 0; padding: 2px 8px; font-size: .8rem; line-height: 1.4; }
code.code { font-family: Consolas, "Cascadia Mono", monospace; font-size: .95em; letter-spacing: .06em; }

/* ---------- Anmeldung ---------- */
.auth { display: grid; place-items: center; min-height: 60vh; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; font-weight: 850; margin: 4px 0 2px; }
.auth-card form { display: grid; gap: 10px; margin-top: 14px; }
.auth-card .actions { margin-top: 4px; }
.auth-foot { margin-top: 16px; font-size: .9rem; }

/* ---------- Status-Abzeichen ---------- */
.status {
  display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800;
  letter-spacing: .02em; white-space: nowrap; border: 1px solid transparent; background: var(--surface-3); color: var(--text);
}
.status.open { background: var(--surface-3); color: var(--text); border-color: var(--line-strong); }
.status.offer { background: var(--accent-blue); color: #fff; }
.status.paused { background: var(--orange-tint); color: var(--text); border-color: var(--accent-orange); }
.status.won { background: var(--success); color: #172000; }
.status.lost { background: var(--danger-tint); color: var(--danger); border-color: var(--danger); }

/* ---------- Tabellen ---------- */
.table-wrap { overflow-x: auto; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.data td.nowrap { white-space: nowrap; }
table.data a.lead { color: var(--text); font-weight: 700; text-decoration: none; }
table.data a.lead:hover { text-decoration: underline; }
table.data td .sub { display: block; color: var(--muted); font-size: .8rem; font-weight: 400; }
table.data td.text { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.data tr.inactive td { color: var(--muted-2); }
table.data td select { min-height: 30px; padding: 2px 6px; font-size: .88rem; }

/* ---------- Kacheln und Raster ---------- */
.stat.danger::before { background: var(--danger); }
.stat.lime::before { background: var(--accent-lime); }
.stat.cyan::before { background: var(--accent-cyan); }
.stat small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.grid.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.filterbar form, .filterbar-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; width: 100%; }
.filterbar .field.small, .filterbar-form .field.small { min-width: 160px; }
.filterbar-form .field:first-child { flex: 1 1 220px; }

/* ---------- Logowand ---------- */
.logo-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.logo-tile {
  display: grid; justify-items: center; gap: 4px; padding: 14px 10px; border-radius: var(--radius); text-align: center;
  background: var(--surface-2); border: 1px solid var(--line); color: inherit; text-decoration: none;
}
.logo-tile:hover { background: var(--table-hover); border-color: var(--accent-cyan); }
.logo-tile img { width: 56px; height: 56px; object-fit: contain; border-radius: 10px; background: #fff; }
.logo-tile .initials {
  width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-weight: 850; font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan)); color: #fff;
}
.logo-tile b { font-size: .9rem; line-height: 1.2; }
.logo-tile small { color: var(--muted); font-size: .76rem; }

/* ---------- Netzwerkwahl ---------- */
.net-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.net-tile {
  width: 100%; display: grid; gap: 4px; text-align: left; padding: 14px; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line); color: inherit; cursor: pointer; font: inherit;
}
.net-tile:hover { border-color: var(--accent-cyan); background: var(--table-hover); }
.net-tile.active { border-color: var(--accent-lime); box-shadow: 0 0 0 2px var(--accent-lime) inset; }
.net-tile b { font-size: 1rem; }
.net-tile span { color: var(--muted); font-size: .82rem; }

/* ---------- Lead-Detail ---------- */
.lead-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(320px, 1fr); gap: 16px; align-items: start; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
dl.facts dt { color: var(--muted); font-size: .82rem; font-weight: 700; padding-top: 2px; }
dl.facts dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 150px 1fr; gap: 4px 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline .when { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.timeline .who { display: block; color: var(--muted-2); font-size: .78rem; }
.timeline .text { white-space: pre-wrap; margin-top: 4px; }

/* ---------- Hilfe ---------- */
.help-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 8px 0 10px; }
.help-dl dt { font-weight: 800; padding-top: 1px; }
.help-dl dd { margin: 0; }

/* ---------- Responsiv: Tablet und Smartphone ---------- */
main { grid-template-columns: minmax(0, 1fr); }
main > *, .hero > div, .lead-grid > *, .grid.two > * { min-width: 0; }
.fab { display: none; }

@media (max-width: 900px) {
  .lead-grid, .grid.two { grid-template-columns: 1fr; }
  .timeline li { grid-template-columns: 1fr; }
  .nav-new { display: none; }
  .fab {
    display: flex; align-items: center; justify-content: center; position: fixed; right: 18px; bottom: 18px; z-index: 30;
    width: 56px; height: 56px; border-radius: 50%; font-size: 2rem; font-weight: 700; line-height: 1; text-decoration: none;
    color: #fff; background: linear-gradient(135deg, #1a7fb0, #2f9fcc); box-shadow: 0 6px 18px rgba(0,0,0,.35);
  }
}

@media (max-width: 760px) {
  main { padding: 14px 12px 110px; gap: 12px; }
  .hero { padding: 16px 14px 14px; gap: 12px; }
  .hero h1 { font-size: 1.5rem; overflow-wrap: anywhere; }
  .hero .sub { font-size: .9rem; }
  .card { padding: 14px; }
  .card-head { flex-wrap: wrap; gap: 4px 10px; }
  .card-meta { white-space: normal; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat b { font-size: 1.5rem; }
  button, .button { min-height: 40px; }
  input, select, textarea { font-size: 16px; }
  .actions { justify-content: stretch; }
  .actions > * { flex: 1 1 auto; }
  .table-wrap { margin: 0 -14px; padding: 0 14px; }
  table.data { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data.leads th:first-child, table.data.leads td:first-child {
    position: sticky; left: 0; z-index: 1; background: var(--surface); box-shadow: 1px 0 0 var(--line);
  }
  table.data.leads tbody tr:nth-child(even) td:first-child { background: var(--surface-2); }
  .admin-nav { justify-self: stretch; max-width: 100%; display: flex; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; scrollbar-width: thin; }
  .filterbar .field.small, .filterbar-form .field.small { min-width: 0; flex: 1 1 45%; }
  .logo-wall { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}

@media (max-width: 520px) {
  .nav { padding: 6px 10px; row-gap: 6px; }
  .nav-links { order: 3; flex-basis: 100%; overflow-x: auto; white-space: nowrap; gap: 0; margin: 0 -10px; padding: 0 10px; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { padding: 6px 9px; }
  .nav-right { gap: 8px; }
  .nav .net-pick { display: none; }
  .theme-pick select { min-height: 30px; font-size: .8rem; }
}

/* Feld-Fehler: nur zeigen, wenn Text da ist (leere Validierungs-Spans dürfen keine roten Balken erzeugen) */
span.error { display: block; padding: 0; margin: -6px 0 0; background: none; border: 0; color: var(--danger); font-size: .85rem; font-weight: 700; }
span.error:empty, div.error:empty { display: none; }

/* Kopfleiste: nichts darf umbrechen; bei mittlerer Breite fallen Beschriftung und Netzwerkname weg */
.nav .nav-new, .nav .who, .nav .net-pick, .nav button.link { white-space: nowrap; }
.nav .nav-right { flex-shrink: 0; }
@media (max-width: 1180px) { .nav .theme-pick span { display: none; } }
@media (max-width: 1040px) { .nav .net-pick { display: none; } }

/* ---------- Phase 1: Lead-Formular, Auswertung, Einstellungen ---------- */
.grid.two.tight { gap: 10px; }
.lead-form .card h2 { margin-bottom: 8px; }
.lead-form .field { margin-bottom: 8px; }
.note { padding: 10px 14px; border-radius: var(--radius-sm); background: var(--orange-tint); border-left: 4px solid var(--accent-orange); }
.filter-toggle, .ftoggle { display: none; }
.pipe { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.pipe a { display: block; padding: 12px 14px; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: inherit; position: relative; overflow: hidden; }
.pipe a:hover { background: var(--table-hover); }
.pipe a::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--line-strong); }
.pipe a.offer::before { background: var(--accent-blue); }
.pipe a.paused::before { background: var(--accent-orange); }
.pipe a.won::before { background: var(--success); }
.pipe a.lost::before { background: var(--danger); }
.pipe b { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pipe span { color: var(--muted); font-size: .82rem; font-weight: 700; }
.bar { height: 8px; border-radius: 999px; background: var(--table-stripe); overflow: hidden; min-width: 80px; }
.bar > div { height: 100%; background: linear-gradient(90deg, var(--accent-blue), var(--accent-lime)); }
table.data tr.me td { background: var(--table-hover); }
table.data.prefs td.num input { width: 20px; height: 20px; }
.logo-sm { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; background: #fff; }
.inline-edit { display: grid; grid-template-columns: 1fr; gap: 4px; min-width: 220px; }
.inline-edit input { min-height: 30px; padding: 2px 8px; font-size: .88rem; }
.inline-edit button { justify-self: start; }
.sort-link { color: inherit; text-decoration: none; }
.sort-link:hover { text-decoration: underline; }
.sort-link.active::after { content: " ▾"; color: var(--accent-cyan); }
.sort-link.active.asc::after { content: " ▴"; }
.quick-status { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.quick-status .field { margin: 0; flex: 1 1 180px; }
.lead-head { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.lead-head .status { font-size: .9rem; }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.rep-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filterbar .field.search { flex: 1 1 220px; }

@media (max-width: 760px) {
  .hide-m { display: none; }
  .filter-toggle { display: inline-flex; width: 100%; justify-content: space-between; }
  .filterbar form { display: none; }
  .filterbar .ftoggle:checked ~ form { display: flex; margin-top: 10px; }
  .filterbar form > button, .filterbar form > .button { flex: 1 1 45%; text-align: center; }
  .quick-status .field { flex: 1 1 100%; }
  .quick-status button { width: 100%; }
  .hero > form, .hero-actions, .rep-pick { width: 100%; }
  .hero-actions { justify-content: flex-start; }
}

/* ---------- Phase 2: Erfassung (Sprache, Scan), Karte, Standort-Erinnerung ---------- */
.capture-tabs { margin-bottom: 4px; }
.capture-tabs button { font: inherit; cursor: pointer; }
.capture-panel { border-left: 4px solid var(--accent-cyan); }
.actions.tight { margin-top: 2px; gap: 8px; }
button.rec { background: var(--danger) !important; color: #fff !important; border-color: var(--danger) !important; }
.scan-preview { display: block; max-width: 100%; max-height: 260px; margin-top: 10px; border-radius: var(--radius-sm); border: 1px solid var(--line); }
#draft-info ul { margin: 6px 0 0; padding-left: 18px; }
#draft-info ul:empty { display: none; }
#draft-info details { margin-top: 6px; }
#draft-info summary { cursor: pointer; font-size: .85rem; color: var(--muted); }
.map-link { display: block; margin-top: 14px; }
.map-img { display: block; width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); }
.geo-toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 50; width: min(520px, calc(100% - 24px));
  padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--accent-cyan);
  box-shadow: 0 10px 30px rgba(0,0,0,.4); display: grid; gap: 10px;
}
.geo-item { display: grid; gap: 2px; }
.geo-item b { font-size: 1rem; }
.geo-item small { color: var(--muted); }
.geo-toast .actions { margin: 0; }
.pac-container { z-index: 60; border-radius: var(--radius-sm); font-family: inherit; }
@media (max-width: 760px) { .geo-toast { bottom: 84px; } }

/* ---------- Phase 3: Kalender ---------- */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { margin: 0; min-width: 180px; text-align: center; }
.cal-head .primary.small { margin-left: auto; padding: 6px 12px; }
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-wd { font-size: .75rem; color: var(--muted); text-align: center; padding: 4px 0; }
.cal-day { min-height: 74px; background: var(--surface-2); border-radius: 6px; padding: 4px; display: flex; flex-direction: column; gap: 2px; }
.cal-day.other { opacity: .45; }
.cal-day.today { outline: 2px solid var(--accent-lime); }
.cal-num { font-size: .75rem; color: var(--muted); }
.cal-ev { display: block; font-size: .72rem; line-height: 1.25; padding: 2px 4px; border-radius: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; text-decoration: none; }
.cal-ev.net { background: var(--accent-blue); }
.cal-ev.lead { background: var(--accent-cyan); color: #04202a; }
.cal-ev.off { text-decoration: line-through; opacity: .5; }
.cal-ev.sel { outline: 2px solid var(--text); }
.cal-legend { margin-top: 10px; display: flex; gap: 8px; }
.cal-legend .cal-ev { display: inline-block; }
.rsvp button.active { background: var(--accent-lime); color: #172000; }
.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
@media (max-width: 720px) { .cal-day { min-height: 54px; } .cal-ev { font-size: .62rem; } }

/* ---------- Phase 3: Chat ---------- */
.chat-grid { grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); }
.chat-card { display: flex; flex-direction: column; min-height: 60vh; position: relative; }
.chat-log { flex: 1 1 auto; overflow-y: auto; max-height: 62vh; display: flex; flex-direction: column; gap: 8px; padding: 4px 2px; }
.chat-msg { max-width: 85%; background: var(--surface-2); border-radius: 10px; padding: 6px 10px; align-self: flex-start; }
.chat-msg.mine { align-self: flex-end; background: var(--accent-blue); color: #fff; }
.chat-msg.mine .chat-meta, .chat-msg.mine .chat-meta span { color: rgba(255,255,255,.8); }
.chat-msg.mine a { color: #fff; text-decoration: underline; }
.chat-msg.deleted .chat-text { color: var(--muted); font-style: italic; }
.chat-meta { font-size: .72rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.chat-del { background: none; border: 0; color: inherit; cursor: pointer; opacity: .6; padding: 0 4px; font-size: .9rem; }
.chat-del:hover { opacity: 1; }
.chat-text { white-space: pre-wrap; word-break: break-word; }
.chat-at { color: var(--accent-lime); font-weight: 600; }
.chat-msg.mine .chat-at { color: #fff; text-decoration: underline; }
.chat-form { display: flex; gap: 8px; margin-top: 10px; align-items: flex-end; }
.chat-form textarea { flex: 1 1 auto; resize: vertical; }
.chat-mentions { position: absolute; left: 16px; bottom: 70px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3); display: flex; flex-direction: column; z-index: 5; }
.chat-mentions button { background: none; border: 0; text-align: left; padding: 6px 12px; color: var(--text); cursor: pointer; }
.chat-mentions button:hover { background: var(--surface-2); }
.chat-mentions button span { color: var(--muted); font-size: .8rem; margin-left: 6px; }
.chat-members button.link { padding: 0; }
@media (max-width: 900px) { .chat-grid { grid-template-columns: 1fr; } .chat-log { max-height: 50vh; } }

/* ---------- Phase 3: Beitrag ---------- */
.packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; }
.package { display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.package .price { font-size: 1.4rem; font-weight: 700; }
.package .price small { font-size: .75rem; font-weight: 400; color: var(--muted); margin-left: 4px; }
.package button { margin-top: auto; }
.inline-details { display: inline-block; }
.inline-details summary { list-style: none; cursor: pointer; }
.stack { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; min-width: 200px; }

/* ---------- Phase 4: Onboarding und Netzwerk-Umschalter ---------- */
.steps { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.steps li.done { opacity: .7; }
.steps .tick { flex: 0 0 24px; height: 24px; border-radius: 50%; border: 2px solid var(--line-strong); display: inline-flex; align-items: center; justify-content: center; font-size: .8rem; }
.steps li.done .tick { background: var(--accent-lime); border-color: var(--accent-lime); color: #172000; }
.steps .sub { display: block; color: var(--muted); font-size: .85rem; }
.nav .net-switch select { max-width: 200px; padding: 4px 8px; font-size: .85rem; border-radius: 8px; }
@media (max-width: 1040px) { .nav .net-switch { display: none; } }

/* ---------- Phase 4: Hilfe ---------- */
.help-toc { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0 0 16px; }
.help-toc a { font-size: .9rem; }
.shot { margin: 8px 0 14px; }
.shot img { width: 100%; max-width: 760px; border-radius: 10px; border: 1px solid var(--line-strong); box-shadow: 0 8px 24px rgba(0,0,0,.25); display: block; }
.shot figcaption { color: var(--muted); font-size: .85rem; margin-top: 6px; }
button.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
button.danger:hover { filter: brightness(1.1); background: var(--danger); }
