/* Dial Tracker.
 *
 * Tokens only — no new hex, no off-scale type. Where a value looks arbitrary it
 * is matched to an existing page (the table borrows the CRM's density, the
 * popovers borrow the import modal's) so the two screens an agent moves between
 * all day do not feel like different products.
 */

.dials-page { overflow: auto; }

.dials-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 22px 32px;
  max-width: 1400px;
}

/* ── Header ── */
.dials-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.dials-title {
  margin: 0;
  font-size: 21px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.dials-subtitle {
  margin: 4px 0 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 62ch;
}
/* Always visible, never stranded in an empty state: leads arrive continuously,
   so the way to add them cannot be a thing you only see when you have none. */
.dials-header-actions { display: flex; gap: 8px; align-items: center; }
/* Flex, like the shell it sits in: a grid track would widen to the table and
   scroll the whole page sideways instead of scrolling the table. */
.dials-leads-view { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.dials-leads-view[hidden], .dials-log-view[hidden] { display: none; }

/* Leads | Dial log. A segmented control, because the two are views of one
   page rather than two destinations. */
.dials-mode {
  display: inline-flex;
  padding: 2px;
  background: var(--bg-warm);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dials-mode button {
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.dials-mode button[aria-pressed="true"] { color: var(--text); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,0.08); }
.dials-mode button:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

/* ── Dial log (pages/dial-log.js) ── */
.dl { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; min-width: 0; }
.dl-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px 14px; }
.dl-field { display: grid; gap: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.dl-field select, .dl-field input {
  padding: 6px 8px; font: inherit; font-size: 13px; font-weight: 400; color: var(--text);
  background: var(--surface); border: 1px solid var(--border); border-radius: 7px;
}
.dl-custom { display: flex; gap: 10px; }
.dl-custom[hidden] { display: none; }
.dl-grain { display: inline-flex; border: 1px solid var(--border); border-radius: 7px; overflow: hidden; align-self: flex-end; }
.dl-grain button {
  padding: 6px 11px; font: inherit; font-size: 13px; color: var(--text-muted);
  background: var(--surface); border: 0; border-left: 1px solid var(--border); cursor: pointer;
}
.dl-grain button:first-child { border-left: 0; }
.dl-grain button[aria-pressed="true"] { color: var(--text); background: var(--gold-soft); font-weight: 600; }
.dl-export { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.dl-include { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.dl-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; min-width: 0; }
.dl-range { margin: 0; font-size: 13px; font-weight: 600; color: var(--text); }
.dl-range span { font-weight: 400; color: var(--text-muted); }
.dl-empty { padding: 36px 12px; text-align: center; }
.dl-caveat { margin: -10px 0 0; font-size: 12.5px; color: var(--text-muted); }
.dl-dim { color: var(--text-dim, var(--text-muted)); }
.dl-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }

.dl-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.dl-tile {
  display: grid; gap: 2px; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
}
.dl-tile-num { font-size: 26px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--text); }
.dl-tile-label { font-size: 12.5px; color: var(--text-muted); }
.dl-tile-label em { font-style: normal; color: var(--text-dim, var(--text-muted)); }

.dl-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; min-width: 0; }
.dl-h { margin: 0; font-size: 12px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); }
.dl-bars { display: grid; gap: 2px; max-width: 720px; }
.dl-bar-row {
  display: grid; grid-template-columns: minmax(120px, 1.1fr) minmax(80px, 2fr) 56px 52px;
  gap: 12px; align-items: center; padding: 5px 0; font-size: 13px;
  border-bottom: 1px solid var(--border-light);
}
.dl-bar-track { height: 8px; background: var(--bg-warm); border-radius: 3px; overflow: hidden; }
.dl-bar-fill { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.dl-bar-fill.is-vm   { background: var(--amber); }
.dl-bar-fill.is-no   { background: var(--red); }
.dl-bar-fill.is-appt { background: var(--green); }

.dl-scroll { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.dl-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dl-table th, .dl-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border-light); white-space: nowrap; }
.dl-table thead th { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); background: var(--bg-warm); }
.dl-table th.dl-num, .dl-table td.dl-num { text-align: right; }
.dl-table tbody th { font-weight: 550; color: var(--text); }
.dl-table tr.is-zero th, .dl-table tr.is-zero td { color: var(--text-dim, var(--text-muted)); }
.dl-table tfoot th, .dl-table tfoot td { font-weight: 650; border-top: 1px solid var(--border); border-bottom: 0; }
.dl-mini { display: inline-block; width: 56px; height: 6px; margin-right: 10px; vertical-align: middle; overflow: hidden; background: var(--bg-warm); border-radius: 3px; }
.dl-mini i { display: block; height: 100%; background: var(--gold); border-radius: 3px; }
.dl-calls td.dl-notes { white-space: normal; min-width: 220px; max-width: 420px; color: var(--text-muted); }
.dl-when { font-variant-numeric: tabular-nums; }
.dl-lead { padding: 0; font: inherit; color: var(--text); background: none; border: 0; cursor: pointer; text-align: left; }
.dl-lead:hover { color: var(--gold); text-decoration: underline; }
.dl-more { justify-self: start; }

.dl-history { width: min(520px, 100%); }
.dl-history-body { display: grid; gap: 8px; margin: 12px 0 4px; }
.dl-history-count { margin: 0; font-size: 12.5px; color: var(--text-muted); }
.dl-history-list { margin: 0; padding: 0; list-style: none; display: grid; }
.dl-history-list li { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; padding: 9px 0; border-bottom: 1px solid var(--border-light); font-size: 13px; }
.dl-history-outcome { font-weight: 600; color: var(--text); }
.dl-history-note { grid-column: 1 / -1; margin: 2px 0 0; color: var(--text-muted); white-space: pre-wrap; }

/* ── Save as PDF ──
   Built into <body> only for the length of the print dialog. Everything else on
   the page is hidden while it prints, so the PDF is the report and nothing
   else: no sidebar, no controls, no other tabs. */
.dl-print { display: none; }
@media print {
  @page { margin: 14mm 12mm; }
  body.dl-printing > *:not(.dl-print) { display: none !important; }
  body.dl-printing { background: #fff !important; }
  body.dl-printing .dl-print {
    display: block; color: #111; background: #fff;
    font: 10.5pt/1.45 "Segoe UI", system-ui, -apple-system, Arial, sans-serif;
  }
  .dl-print h1 { margin: 0 0 2pt; font-size: 18pt; }
  .dl-print h2 { margin: 16pt 0 6pt; font-size: 11pt; text-transform: uppercase; letter-spacing: 0.05em; color: #333; }
  .dl-print-range { margin: 0; font-size: 11.5pt; font-weight: 600; }
  .dl-print-meta { margin: 2pt 0 0; font-size: 9pt; color: #555; }
  .dl-print-tiles { display: flex; gap: 10pt; margin-top: 12pt; }
  .dl-print-tiles div { flex: 1; padding: 8pt 10pt; border: 1px solid #ccc; border-radius: 4pt; }
  .dl-print-tiles strong { display: block; font-size: 16pt; }
  .dl-print-tiles span { font-size: 9pt; color: #555; }
  .dl-print table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
  .dl-print th, .dl-print td { padding: 3pt 6pt; border-bottom: 0.5pt solid #ccc; text-align: left; }
  .dl-print thead th { border-bottom: 1pt solid #333; font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.04em; }
  .dl-print tfoot td { border-top: 1pt solid #333; font-weight: 700; }
  .dl-print .n { text-align: right; font-variant-numeric: tabular-nums; }
  .dl-print tr { page-break-inside: avoid; }
  .dl-print-note { margin-top: 10pt; font-size: 9pt; color: #555; }
}

/* ── Controls ── */
.dials-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.dials-tabs { display: flex; gap: 4px; }
.dials-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}
.dials-tab:hover { background: var(--bg-warm); color: var(--text); }
.dials-tab.is-active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.dials-tab-count {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

/* Search leads the control row, because finding one person is the job. */
.dials-search-wrap { flex: 1 1 260px; min-width: 200px; }
.dials-search {
  width: 100%;
  padding: 8px 11px;
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.dials-search:focus { border-color: var(--gold); outline: none; }

.dials-filters { display: flex; gap: 6px; align-items: center; }

/* One button, not three selects.
   Three side-by-side dropdowns made the widest thing in the control row a set
   of filters nobody touches more than once a session, on a screen whose job is
   finding one person fast. Same consolidation the CRM ribbon already made. */
.dials-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.dials-filter-btn:hover { background: var(--bg-warm); }
/* A filter you cannot see is a filter you forget you set, and then "no leads
   match" gets misread as "this person is not in Arsenal". The button carries
   the count; each menu row carries its value. */
.dials-filter-btn.is-active { border-color: var(--gold); color: var(--gold); }
.dials-filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--gold);
  border-radius: 8px;
}

/* Menu rows for the filter panels. */
.dials-filter-current {
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
}
.dials-filter-back {
  color: var(--text-muted);
  font-size: 12px;
  border-bottom: 1px solid var(--border-light);
  border-radius: 0;
  margin-bottom: 3px;
}
.dials-menu-item.is-on   { font-weight: 650; }
.dials-menu-item.is-clear { color: var(--text-muted); }
.dials-menu-item.is-clear:hover { color: var(--red); }

/* ── Cross-tab and filtered-out notices ──
   Buttons, not text. Each one names something the page knows about and is not
   showing, and clicking it goes there. A notice you cannot act on is just an
   apology. */
.dials-notes { display: flex; flex-direction: column; gap: 6px; }
.dials-note {
  align-self: flex-start;
  padding: 7px 11px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 500;
  text-align: left;
  border-radius: 7px;
  border: 1px solid transparent;
  cursor: pointer;
}
.dials-note.is-cross {
  color: var(--text);
  background: var(--bg-warm);
  border-color: var(--border);
}
.dials-note.is-partial {
  color: var(--gold);
  background: var(--gold-soft, rgba(176, 141, 87, 0.08));
}
.dials-note:hover { filter: brightness(1.04); }

/* ── Table ── */
.dials-table-wrap {
  border: 1px solid var(--border-light);
  border-radius: 9px;
  overflow: auto;
  background: var(--surface);
}
.dials-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.dials-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 9px 10px;
  text-align: left;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-warm);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.dials-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text);
  vertical-align: middle;
}
.dials-table tbody tr:hover { background: var(--bg-warm); }
.dials-td-num { font-variant-numeric: tabular-nums; }
.dials-td-phone { font-variant-numeric: tabular-nums; white-space: nowrap; }
.dials-td-actions { text-align: right; white-space: nowrap; }

/* With no leads at all the header row labels eight columns of nothing and
   forces a horizontal scroll across an empty table. Collapse it, the way the
   CRM does. */
.dials-table.is-blank thead { display: none; }
.dials-table.is-blank { width: 100%; }

.dials-row.is-not-dialing { opacity: 0.78; }

.dials-name {
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  color: var(--text);
  background: none;
  border: 0;
  cursor: pointer;
  text-align: left;
}
.dials-name:hover { color: var(--gold); text-decoration: underline; }

/* The reason a lead is not being dialed. On the row, not in a tab name — that
   is the whole reason there are two tabs instead of three. */
.dials-reason {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}
.dials-chip {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 5px;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: 4px;
  color: var(--surface);
  background: var(--text-muted);
  vertical-align: middle;
}
.dials-chip.is-warn { background: var(--gold); color: #fff; }

/* ── Row actions ── */
.dials-quick,
.dials-act {
  padding: 4px 8px;
  margin-left: 4px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  /* Fitts's law: these are hit dozens of times an hour between calls. 26px is
     the smallest this can be without the row growing. */
  min-height: 26px;
}
.dials-act:hover { background: var(--bg-warm); border-color: var(--text-muted); }
.dials-act { color: var(--text-muted); }

/* The three quick outcomes: the miss, the no, and the win.
 *
 * Icon only. "VM / No / Appt" put a two-letter abbreviation on the control an
 * agent hits most, and "No" was genuinely ambiguous — it could as easily have
 * meant no-answer as not-interested. The glyph is an emoji in the markup, which
 * emoji-icons.js draws as an outline icon under Arsenal and leaves as an emoji
 * in every other appearance, so this needs no theme branch.
 *
 * PASTEL, NOT SOLID. These repeat in every row of a long table; three saturated
 * chips per row would turn the list into a colour chart and bury the names,
 * which are the thing being scanned for. Colour reinforces the shape here, it
 * never carries meaning alone — each button has a distinct glyph, a title and
 * an aria-label.
 */
.dials-quick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  border-color: transparent;
}
.dials-quick.is-vm   { color: var(--amber); background: var(--amber-soft); }
.dials-quick.is-no   { color: var(--red);   background: var(--red-soft); }
.dials-quick.is-appt { color: var(--green); background: var(--green-soft); }

/* Hover states borrow the same hue rather than the generic grey, so the button
   confirms which outcome is about to be logged before the click. */
.dials-quick:hover        { filter: brightness(0.96); }
.dials-quick.is-vm:hover   { border-color: var(--amber); }
.dials-quick.is-no:hover   { border-color: var(--red); }
.dials-quick.is-appt:hover { border-color: var(--green); }
.dials-quick:focus-visible { outline: 2px solid var(--text); outline-offset: 1px; }

/* ── Empty states ── */
.dials-empty-row td { border-bottom: 0; }
.dials-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 52px 24px;
  text-align: center;
}
.dials-empty-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}
.dials-empty-hint {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 52ch;
  line-height: 1.5;
}
.dials-empty-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ── Popovers ──
   Appended to <body> and positioned in viewport coordinates, because the table
   is a scroll container that would clip anything inside it. Same treatment and
   the same z-index band as the import modal's flag popover. */
.dials-pop {
  position: fixed;
  z-index: 4000;
  min-width: 190px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 9px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
}
.dials-pop.is-when,
.dials-pop.is-note { min-width: 260px; padding: 12px; }

.dials-menu { display: flex; flex-direction: column; }
.dials-menu-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
}
.dials-menu-item:hover { background: var(--bg-warm); }
/* Do Not Call. Marked in the menu rather than promoted to the row, because it
   writes to a permanent shared list and there is no undo. */
.dials-menu-item.is-danger { color: var(--red); }
.dials-menu-sep { height: 1px; margin: 4px 6px; background: var(--border); }

/* ── Delete confirmation (components/delete-client-modal.js) ──
   Shared by the dial tracker and the CRM. */
.dcm { display: grid; gap: 12px; }
.dcm .dials-modal-title { margin: 0; }
.dcm-lead, .dcm-final { margin: 0; font-size: 13.5px; color: var(--text); }
.dcm-final { color: var(--text-muted); }
.dcm-choices { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.dcm-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.dcm-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.dcm-choice:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.dcm-choice.is-wide:has(input:checked) { border-color: var(--red); background: var(--red-soft); }
.dcm-choice input { margin-top: 3px; accent-color: var(--gold); }
.dcm-choice.is-wide input { accent-color: var(--red); }
.dcm-choice span { display: grid; gap: 2px; font-size: 13.5px; }
.dcm-choice small { font-size: 12.5px; color: var(--text-muted); }
.dcm-facts { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 12.5px; color: var(--text-muted); }
.dcm .dcm-go { background: var(--red); border-color: var(--red); color: #fff; }
.dcm .dcm-go:hover { filter: brightness(0.92); }
.dials-menu-note {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.dials-when-label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.dials-when-input,
.dials-note-input {
  width: 100%;
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  box-sizing: border-box;
}
.dials-note-input { resize: vertical; min-height: 90px; }
.dials-when-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 10px;
}

/* ── Manual add ── */
.dials-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 4100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.34);
  padding: 20px;
}
.dials-modal {
  width: min(460px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}
.dials-modal-title {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 650;
  color: var(--text);
}
.dials-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}
.dials-form label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}
.dials-form input,
.dials-form select,
.dials-form textarea {
  padding: 7px 9px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
}
.dials-form input:focus,
.dials-form select:focus,
.dials-form textarea:focus { border-color: var(--gold); outline: none; }
.dials-form textarea { resize: vertical; min-height: 72px; line-height: 1.45; }
.dials-form input[readonly] { background: var(--bg-warm); color: var(--text-muted); }

/* `display: flex` above beats the user-agent rule the `hidden` attribute relies
   on, exactly as .nav-item did. The "+ New vendor" field ships hidden and is
   revealed on demand, so without this it is simply always visible. */
.dials-form label[hidden] { display: none; }

/* Progressive disclosure: name, phone and line are enough to dial someone, so
   the other six are one click away rather than in the way. */
.dials-more { margin-top: 12px; }
.dials-more > summary {
  cursor: pointer;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0;
}
.dials-more[open] > summary { margin-bottom: 8px; }

/* At the point of failure, not in a list after submit. */
.dials-form-error {
  margin: 12px 0 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--red);
}
.dials-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
}

/* ── Lead panel ──
 * The shell (#lead-panel, #lp-backdrop) and every .cp-* internal come from
 * components/table.css, shared with the client panel on purpose. Only what is
 * unique to a LEAD lives here: the status chips, the attempt log, and the
 * action list. See components/lead-panel.js for why they are separate elements.
 */
.lp-chip {
  display: inline-block;
  margin-right: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  color: var(--text);
  background: var(--bg-warm);
  border: 1px solid var(--border-light);
}
.lp-chip.is-muted { color: var(--text-muted); }
.lp-chip.is-ok { color: var(--green); background: var(--green-soft); border-color: transparent; }

/* ── Lead panel: edit mode ──
   The same form language as Add a lead (.dials-form), so correcting a lead
   looks like entering one. */
.lp-edit-form label.lp-edit-wide { grid-column: 1 / -1; }
/* Hidden while editing. Explicit, because a button style that sets `display`
   silently beats the `hidden` attribute -- the trap .nav-item fell into. */
#lp-edit[hidden] { display: none; }
.lp-required { color: var(--red); }
.lp-field-error { font-size: 12px; font-weight: 500; color: var(--red); }
.lp-field-hint { font-size: 12px; font-weight: 400; color: var(--text-muted); }
.dials-form label.has-error input,
.dials-form label.has-error select,
.dials-form label.has-error textarea { border-color: var(--red); }
.lp-edit-more > summary { padding: 0; }
.lp-edit-note {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 12px;
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--text-muted);
  background: var(--gold-soft);
  border-radius: 8px;
}
.lp-info-i {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 1px;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font: italic 700 10.5px/13px Georgia, "Times New Roman", serif;
  text-align: center;
}
/* Sticks to the bottom of the scrolling panel so Save is never a scroll away. */
.lp-edit-footer {
  position: sticky;
  bottom: 0;
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding: 12px 0 4px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
.lp-edit-buttons { display: flex; justify-content: flex-end; gap: 8px; }
.lp-edit-message {
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--red);
  background: var(--red-soft);
  border-radius: 7px;
}
.lp-edit-message.is-warn { color: var(--text); background: var(--amber-soft); }
.cp-body > .lp-edit-message { margin-bottom: 12px; }
.lp-warn { color: var(--amber); }

/* One dated line per attempt, never overwritten: three calls are three rows.
   This is what an agent reads before they speak, so the outcome sits on the
   same line as the date rather than under it. */
.lp-attempt {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
.lp-attempt:last-child { border-bottom: 0; }
.lp-attempt-when {
  min-width: 96px;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.lp-attempt-what { font-weight: 550; color: var(--text); }
.lp-attempt-note {
  flex-basis: 100%;
  margin-left: 104px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.45;
}

.lp-actions { display: flex; flex-direction: column; gap: 6px; }
.lp-action {
  padding: 8px 11px;
  font: inherit;
  font-size: 13px;
  font-weight: 550;
  text-align: left;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  cursor: pointer;
}
.lp-action:hover { background: var(--bg-warm); border-color: var(--text-muted); }

/* ── Toast ── */
.dials-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 4200;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 550;
  color: var(--surface);
  background: var(--text);
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  opacity: 1;
  transition: opacity 0.35s ease;
}
