/* Leads list and detail (D-103). Back-office tokens only. */

/* ---- Table ---- */
.ld-table th,
.ld-table td {
  padding: 14px 16px;
}
.ld-table td {
  vertical-align: top;
}
.ld-table td:nth-child(3),
.ld-table td:nth-child(4) {
  min-width: 140px;
}
.ld-table .btn {
  white-space: nowrap;
}
.ld-table tr.ld-new td:first-child {
  box-shadow: inset 3px 0 0 var(--gold);
}
.ld-person {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 200px;
}
.ld-avatar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--soft);
  color: var(--green);
  font-size: 1.1rem;
  font-weight: 600;
}
.ld-avatar.sm {
  width: 36px;
  height: 36px;
  font-size: 0.9rem;
}
.ld-name {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.ld-name:hover {
  color: var(--blue);
  text-decoration: underline;
}
.ld-tel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.ld-tel:hover {
  color: var(--blue);
}
.ld-table td .sub {
  max-width: 260px;
  overflow-wrap: anywhere;
}
.ld-when {
  white-space: nowrap;
}
.pagehead [data-mail-status] .count {
  padding: 0 7px;
  border-radius: 6px;
  background: #fff1d8;
  color: #775112;
  font-size: 0.78rem;
}
.ld-alert {
  justify-content: flex-start;
  border-color: #f0d7a6;
  background: #fff7e8;
  color: #5c3d08;
}
.ld-alert .btn {
  margin-left: auto;
}

/* ---- Detail dialog ---- */
#modal.ld-dialog {
  max-width: 640px;
}
.ld {
  display: grid;
  gap: 22px;
}
.ld-head {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ld-meta {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
}
.ld-status-now {
  margin: 0;
}
.ld-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: stretch;
}
.ld-contact .btn {
  justify-content: flex-start;
  min-height: 56px;
  text-align: left;
}
.ld-contact .btn span {
  display: grid;
  min-width: 0;
  font-size: 0.8rem;
  font-weight: 400;
}
.ld-contact .btn b {
  overflow: hidden;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.ld-contact .iconbtn {
  height: auto;
  min-height: 56px;
}
.ld-nomail {
  align-self: center;
  margin: 0;
}
.ld-h {
  margin: 0 0 10px;
  font-size: 0.95rem;
}
.ld-facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 16px;
  margin: 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}
.ld-facts dt {
  color: var(--muted);
}
.ld-facts dd {
  margin: 0;
}
.ld-states {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.ld-states legend {
  width: 100%;
  padding: 0;
}
.ld-state input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ld-state span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 20px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--paper);
  cursor: pointer;
  font-size: 0.9rem;
}
.ld-state input:checked + span {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}
.ld-state input:focus-visible + span {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}
.ld-states:disabled .ld-state span {
  opacity: 0.6;
  cursor: progress;
}
.ld-owner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 10px 10px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.ld-owner > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.ld-transfer {
  margin-top: 12px;
}
.ld-transfer[hidden] {
  display: none;
}
.ld-history {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ld-history li {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.ld-history li:last-child {
  border-bottom: 0;
}
.ld-history li > div {
  display: grid;
  gap: 2px;
}
.ld-dot {
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--green);
}
.ld-why {
  font-size: 0.86rem;
}

@media (max-width: 560px) {
  .ld-contact {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .ld-contact .ld-mail,
  .ld-contact .ld-nomail {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
