/* LEAD-REQ-01 (assets/leadreq01.js): the same-phone sheet, the search banner, the Sort menu, the No date chip, the Register's
   "Sale value missing" filter, the Reports line and the sale-value sheet. Colours come from the app's own tokens. */

/* ---------- B2: the No date chip (UX-04's chip row) ---------- */
.ux04-lead-chip.is-blank {
  border-color: var(--orange);
}

/* ---------- B1: searching all leads ---------- */
.leadreq01-search-banner {
  align-items: center;
  background: var(--panel-soft, var(--ui-surface-soft));
  border: 1px solid var(--panel-line, var(--ui-border));
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin: 0 0 12px;
  padding: 8px 12px;
}

.leadreq01-search-banner span {
  color: var(--text-secondary, var(--ui-muted));
  font-size: 13px;
}

.leadreq01-search-banner .ghost-button {
  margin-left: auto;
}

/* ---------- B3: the Sort menu ---------- */
.leadreq01-sort {
  position: relative;
}

.leadreq01-sort > summary {
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.leadreq01-sort > summary::-webkit-details-marker {
  display: none;
}

.leadreq01-sort-list {
  background: var(--panel, var(--ui-surface));
  border: 1px solid var(--panel-line, var(--ui-border));
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
  display: grid;
  min-width: 220px;
  padding: 4px;
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 90; /* r2: above the sticky .lead-crm-table-head (80), below .os-modal (95) and every sheet */
}

.leadreq01-sort-list button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  font: inherit;
  min-height: 36px;
  padding: 6px 10px;
  text-align: left;
}

.leadreq01-sort-list button:hover,
.leadreq01-sort-list button:focus-visible {
  background: var(--panel-soft, var(--ui-surface-soft));
}

.leadreq01-sort-list button.on {
  font-weight: 800;
}

.leadreq01-sort-list button.on::before {
  content: "✓ ";
}

.lv4-filters .leadreq01-sort {
  margin-left: auto;
}

/* ---------- A5: the same-phone sheet ---------- */
.leadreq01-modal {
  z-index: 1200;
}

.leadreq01-choose-body p {
  margin: 0 0 8px;
}

.leadreq01-matches {
  display: grid;
  gap: 4px;
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
}

.leadreq01-matches li {
  background: var(--panel-soft, var(--ui-surface-soft));
  border: 1px solid var(--panel-line, var(--ui-border));
  border-radius: 8px;
  padding: 6px 10px;
}

.leadreq01-more,
.leadreq01-hint {
  color: var(--text-secondary, var(--ui-muted));
  font-size: 13px;
}

.leadreq01-choose-actions {
  flex-wrap: wrap;
}

/* ---------- C2: the Register filter and the Reports line ---------- */
#reg01Register .leadreq01-reg-tools {
  align-items: center;
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}

#reg01Register .reg01-state.leadreq01-missing:not(.active) {
  border-color: var(--orange);
}

.leadreq01-report-line {
  align-items: center;
  border: 1px solid var(--orange);
  border-radius: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  justify-content: space-between;
  margin: 8px 0 0;
  padding: 8px 12px;
}

/* ---------- C2: the sale-value sheet ---------- */
.leadreq01-sale-card {
  display: flex;
  flex-direction: column;
  max-height: min(86vh, 900px);
  max-width: 760px;
  width: calc(100vw - 32px);
}

.leadreq01-sale-body {
  overflow-y: auto;
  padding: 0 16px 16px;
}

.leadreq01-sale-help {
  color: var(--text-secondary, var(--ui-muted));
  font-size: 13px;
  margin: 0 0 10px;
}

.leadreq01-sale-list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.leadreq01-sale-row {
  align-items: center;
  border: 1px solid var(--panel-line, var(--ui-border));
  border-radius: 10px;
  display: grid;
  gap: 6px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 8px 12px;
}

.leadreq01-sale-row.is-saved {
  opacity: 0.75;
}

.leadreq01-sale-who small {
  color: var(--text-secondary, var(--ui-muted));
  display: block;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.leadreq01-sale-state {
  border: 1px solid var(--panel-line, var(--ui-border));
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
}

.leadreq01-sale-state.is-active {
  border-color: var(--green);
}

.leadreq01-sale-edit {
  align-items: center;
  display: flex;
  gap: 6px;
}

.leadreq01-sale-input input {
  max-width: 150px;
  min-height: 36px;
  background: var(--input-bg, #0b1b2b);
  border: 1px solid var(--panel-line, var(--ui-border));
  color: var(--text, #eaf2ff);
}

.leadreq01-sale-input input::placeholder {
  color: var(--muted, #9fb0c8);
  opacity: 1;
}

.leadreq01-sale-input input:disabled {
  opacity: 0.7;
}

.leadreq01-sale-done {
  color: var(--green);
  font-weight: 800;
}

.leadreq01-sale-confirm,
.leadreq01-sale-msg {
  grid-column: 1 / -1;
  margin: 0;
}

.leadreq01-sale-confirm {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-weight: 700;
}

.leadreq01-sale-msg.is-bad {
  color: var(--red);
  font-weight: 700;
}

.leadreq01-sale-msg.is-warn {
  color: var(--orange);
}

.leadreq01-sr {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 640px) {
  .leadreq01-sale-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .leadreq01-sale-input input {
    max-width: none;
    width: 100%;
  }

  .leadreq01-sale-input {
    flex: 1;
  }

  .leadreq01-sort-list {
    left: 0;
    right: auto;
  }
}
