/* ============================================================================
   LIT-CRM — Lead Tracker
   [2026-08-30] The record of what happened to each lead.

   Deliberately the same visual language as the chargeback desk: fixed column
   widths so the columns hold still between loads, one line per row, names
   clipped with an ellipsis rather than wrapped, and separators you can actually
   see. Those decisions were argued out on the chargeback desk this morning;
   re-deciding them differently here would only make two screens that behave
   almost the same.
   ========================================================================== */

/* ── controls ────────────────────────────────────────────────────────────── */
.lt-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px 18px;
  padding: 4px 2px 16px;
}
.lt-field { display: flex; flex-direction: column; gap: 5px; }
.lt-field label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
}
.lt-field .input { min-width: 160px; }
.lt-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }

/* ── the summary strip ───────────────────────────────────────────────────── */
.lt-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  padding: 0 2px 18px;
}
.lt-stat-n { font-size: 1.9rem; font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.lt-stat-l { font-size: 0.8rem; opacity: 0.62; }
.lt-good { color: #15803d; }
.lt-warn { color: #b45309; }

/* ── table ───────────────────────────────────────────────────────────────── */
#ltTable {
  width: 100%;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.9rem;
}
#ltTable thead th {
  padding: 0 10px 9px;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.62;
  text-align: left;
  vertical-align: bottom;
  white-space: normal;
  border-bottom: 2px solid rgba(100, 116, 139, 0.42);
}
#ltTable thead th.cd-r, #ltTable td.lt-r { text-align: right; }

#ltTable th.lt-w-caret   { width: 28px; }
#ltTable th.lt-w-time    { width: 11%; }
#ltTable th.lt-w-cust    { width: 18%; }
#ltTable th.lt-w-source  { width: 12%; }
#ltTable th.lt-w-agent   { width: 14%; }
#ltTable th.lt-w-assoc   { width: 13%; }
#ltTable th.lt-w-stage   { width: 12%; }
#ltTable th.lt-w-first   { width: 9%;  }
#ltTable th.lt-w-outcome { width: 11%; }

#ltTable tbody td {
  padding: 9px 10px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  border-bottom: 1px solid rgba(100, 116, 139, 0.30);
}
#ltTable tbody tr.lt-main { cursor: pointer; }
#ltTable tbody tr.lt-main:hover > td { background: rgba(100, 116, 139, 0.10); }
#ltTable tbody tr.lt-alt > td { background: rgba(100, 116, 139, 0.045); }
#ltTable tbody tr.lt-alt:hover > td { background: rgba(100, 116, 139, 0.10); }
#ltTable tbody tr.lt-main:focus-visible { outline: 2px solid #0369a1; outline-offset: -2px; }
#ltTable tbody tr.lt-main.lt-open > td {
  background: rgba(3, 105, 161, 0.09);
  border-bottom-color: transparent;
  font-weight: 600;
}

.lt-caret { opacity: 0.45; font-size: 0.8rem; }
.lt-num { white-space: nowrap; font-variant-numeric: tabular-nums; }
.lt-strong { font-weight: 650; }

.lt-clip { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* A name beside a chip: the NAME absorbs the clipping, never the chip. */
.lt-line { display: flex; align-items: center; min-width: 0; }
.lt-line > .lt-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-line > .lt-chip { flex: none; margin-left: 6px; }

.lt-chip {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.6;
  white-space: nowrap;
}
.lt-chip-test { background: rgba(100, 116, 139, 0.22); }

/* Stage reads as a state, not as prose. */
.lt-stage {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lt-stage-waiting   { background: #fde68a; color: #78350f; }
.lt-stage-claimed   { background: #e0e7ff; color: #3730a3; }
.lt-stage-contacted { background: #dbeafe; color: #1e40af; }
.lt-stage-assigned  { background: #cffafe; color: #155e75; }
.lt-stage-delivered { background: #dcfce7; color: #166534; }
.lt-stage-closed    { background: rgba(100, 116, 139, 0.2); }

/* ── the expanded row ────────────────────────────────────────────────────── */
#ltTable tbody tr.lt-detail > td {
  padding: 16px 18px 20px 40px;
  overflow: visible;
  white-space: normal;
  background: rgba(100, 116, 139, 0.07);
  border-bottom: 2px solid rgba(100, 116, 139, 0.34);
}
.lt-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px 24px;
}
.lt-fact-l {
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.58;
  margin-bottom: 2px;
}
.lt-fact-v { font-weight: 600; }

.lt-sec { margin-top: 18px; }
.lt-sec-h {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  opacity: 0.58;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(100, 116, 139, 0.22);
}
.lt-quote {
  margin: 0;
  padding-left: 12px;
  border-left: 3px solid rgba(100, 116, 139, 0.35);
  max-width: 82ch;
}
.lt-ev {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 5px 0;
  border-top: 1px dashed rgba(100, 116, 139, 0.22);
}
.lt-ev:first-of-type { border-top: 0; }
.lt-ev-t { font-weight: 600; }
.lt-ev-w { font-size: 0.82rem; opacity: 0.6; white-space: nowrap; font-variant-numeric: tabular-nums; }

.lt-foot { padding: 12px 2px 0; max-width: 84ch; }

@media (max-width: 900px) {
  #ltTable { font-size: 0.84rem; }
  #ltTable tbody td { padding: 8px 7px; }
  .lt-quick { margin-left: 0; }
  #ltTable tbody tr.lt-detail > td { padding-left: 18px; }
}
