/* Lead management uses the same pale workspace, white cards and cyan as its drawer. */
#page-leads {
  --leads-ink: #16374c;
  --leads-muted: #5d788b;
  --leads-line: #e8eff4;
  --leads-cyan: #009fca;
  color: var(--leads-ink);
  background: #f3f8fb;
  padding: 20px 28px 28px;
  container: leads-page / inline-size;
}
#page-leads *, #page-leads *::before, #page-leads *::after { box-sizing: border-box; }
#page-leads [hidden] { display: none !important; }
#page-leads :is(button, input, select) { font-family: inherit; }
#page-leads :is(button, input, select, [tabindex]):focus-visible { outline: 2px solid var(--leads-cyan); outline-offset: 3px; }
#page-leads .leads-create-action {
  min-height: 44px; padding: 10px 20px; gap: 9px; border: 1px solid transparent; border-radius: 10px;
  background: linear-gradient(110deg, #0099c5, #00b9d6); color: #fff; font-size: 13px; font-weight: 700;
  box-shadow: 0 5px 14px #00a8cd18; white-space: nowrap;
}
#page-leads .leads-create-action:hover { background: #008daf; box-shadow: 0 6px 20px #00a8cd30; transform: none; }
#page-leads .leads-create-action svg { width: 19px; height: 19px; flex-shrink: 0; }
#page-leads :is(.leads-filter-card, .leads-table-card) { min-width: 0; background: #fff; border: 1px solid #edf3f7; border-radius: 16px; box-shadow: 0 3px 14px #23445b03; }
#page-leads .leads-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-width: 0; }
#page-leads .leads-section-heading h2 { margin: 0; color: var(--leads-ink); font-size: 15px; font-weight: 700; line-height: 1.5; }
#page-leads .leads-filter-card { padding: 12px 22px; margin-bottom: 16px; position: relative; overflow: visible; z-index: 2; }
#page-leads .task-filter-panel { display: grid; grid-template-columns: minmax(230px, 1.8fr) repeat(4, minmax(116px, 1fr)) auto; align-items: end; gap: 8px 12px; margin: 0; }
#page-leads .task-filter-panel:has([data-admin-scope-filter]:not([hidden])) { grid-template-columns: minmax(128px, 1fr) minmax(220px, 1.8fr) repeat(4, minmax(108px, 1fr)) auto; }
#page-leads .filter-field { min-width: 0; gap: 5px; }
#page-leads .filter-field > label { color: #8ca2b3; font-size: 10px; line-height: 1.4; font-weight: 600; }
#page-leads .filter-field :is(select, input:not([type="checkbox"]):not([type="radio"])),
#page-leads .multi-filter-button { width: 100%; min-width: 0; height: 34px; padding: 0 11px; border: 1px solid #e0ebf2; border-radius: 9px; background: #fbfdfe; color: var(--leads-ink); font-size: 12px; }
#page-leads .filter-field :is(select, input):focus, #page-leads .multi-filter-button[aria-expanded="true"] { border-color: #86d3e5; box-shadow: 0 0 0 3px #00a8cd0e; }
#page-leads .filter-field input::placeholder { color: #91a6b6; opacity: 1; }
#page-leads .leads-search-control { position: relative; min-width: 0; }
#page-leads .leads-search-control > svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: #89a5b5; pointer-events: none; }
#page-leads #lead-filter-search { display: block; padding-inline-start: 38px; }
#page-leads .multi-filter-button > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#page-leads .multi-filter-button:hover { border-color: #93d7e7; background: #f7fcfe; }
#page-leads .multi-filter.open .multi-filter-button { border-color: #86d3e5; background: #f3fbfd; }
#page-leads .multi-filter-menu { top: calc(100% + 7px); min-width: 210px; left: auto; width: max(100%, 210px); max-width: min(300px, calc(100vw - 48px)); max-height: min(420px, 65vh); overflow-y: auto; border-color: #dce9f0; border-radius: 11px; padding: 7px; box-shadow: 0 14px 34px #16374c18; scrollbar-width: thin; scrollbar-color: #d4e1e9 transparent; }
#page-leads .multi-filter-option { color: var(--leads-ink); font-size: 12px; font-weight: 500; padding: 7px 8px; line-height: 1.45; }
#page-leads .multi-filter-option:hover { background: #eff9fc; }
#page-leads .multi-filter-option input[type="checkbox"] { accent-color: var(--leads-cyan); }
#page-leads .leads-filter-reset { justify-content: center; min-height: 34px; padding: 6px 13px; border-color: #d9e8ef; border-radius: 9px; background: #f5fafc; color: #69899c; font-size: 11px; white-space: nowrap; }
#page-leads .leads-filter-reset:hover { border-color: #b3deec; background: #eaf8fc; color: #0097bc; }
#page-leads .leads-table-card { padding: 0; }
#page-leads .leads-table-card > .leads-section-heading { min-height: 48px; padding: 12px 22px; border-bottom: 1px solid var(--leads-line); }
#page-leads .leads-table-summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; min-width: 0; }
#page-leads .leads-table-card .leads-create-action { flex-shrink: 0; margin-inline-start: auto; }
#page-leads #leads-table-info { color: var(--leads-muted); font-size: 11px; line-height: 1.5; }
#page-leads .table-wrap.leads-table-scroll { overflow-x: auto; max-width: 100%; scrollbar-width: thin; scrollbar-color: #cbdfe9 #f6fafc; overscroll-behavior-x: contain; }
#page-leads .leads-table-scroll:focus-visible { outline-offset: -3px; }
#page-leads .leads-table { min-width: 1180px; width: 100%; table-layout: fixed; }
#page-leads th { padding: 9px 10px; background: #f8fbfd; color: #607b8e; font-size: 10px; font-weight: 600; border-bottom: 1px solid var(--leads-line); letter-spacing: normal; text-transform: none; }
#page-leads td { padding: 14px 10px; color: var(--leads-ink); font-size: 12px; line-height: 1.5; border-bottom: 1px solid var(--leads-line); vertical-align: middle; }
#page-leads .lead-name-cell { width: 16%; }
#page-leads .lead-company-col { width: 14%; }
#page-leads .lead-status-col { width: 11%; }
#page-leads .lead-tasks-col { width: 76px; text-align: center; }
#page-leads .lead-owner-col { width: 104px; }
#page-leads .lead-industry-col { width: 90px; }
#page-leads .lead-billing-col { width: 104px; }
#page-leads .lead-source-col { width: 88px; }
#page-leads .lead-note-col { width: auto; }
#page-leads .th-sort { font-size: inherit; font-weight: 600; gap: 4px; padding: 0; min-height: 18px; }
#page-leads .th-sort:hover { color: #009bc0; }
#page-leads .sort-indicator { color: #00a6c7; }
#page-leads .clickable-row:hover > td { background: #f4fbfd; }
#page-leads .lead-health-good > td { background: #f8fdfb; }
#page-leads .lead-health-good:hover > td { background: #eefaf5; }
#page-leads .lead-main-cell { align-items: center; gap: 8px; }
#page-leads .lead-main-cell .flex-cell > div:last-child > div:first-child { white-space: normal; overflow-wrap: anywhere; line-height: 1.5; }
#page-leads .lead-title-wrap { color: var(--leads-ink); font-size: 13px; }
#page-leads .lead-company-cell { color: #365a70; font-size: 12px; font-weight: 500; overflow-wrap: anywhere; }
#page-leads .lead-last-note { max-width: none; }
#page-leads .lead-last-note-title { color: #365a70; font-size: 11px; font-weight: 600; }
#page-leads .lead-last-note-text { color: #5d788b; font-size: 10px; }
#page-leads .lead-billing-cell { color: var(--leads-ink); font-size: 12px; font-weight: 700; min-width: 0; font-variant-numeric: tabular-nums; }
#page-leads .lead-value-auto .lead-billing-cell { color: #148a77; }
#page-leads .lead-billing-cell .lead-billing-meta { font-size: 9px; color: #5d788b; font-weight: 500; }
#page-leads .lead-billing-cell.is-empty { color: #5d788b; }
#page-leads .lead-owner-col .flex-cell { align-items: center; gap: 6px; }
#page-leads .lead-owner-col .avatar-sm { width: 24px; height: 24px; font-size: 9px; }
#page-leads .owner-cell-name { color: #3f647a; font-size: 11px; font-weight: 600; overflow-wrap: anywhere; }
#page-leads .badge { max-width: 100%; padding: 4px 8px; border-radius: 20px; font-size: 10px; font-weight: 600; line-height: 1.45; white-space: normal; overflow-wrap: anywhere; text-align: center; box-shadow: none; }
#page-leads :is(.lead-industry-col, .lead-source-col) .badge { background: #f0f7fa; color: #486b80; border: 0; }
#page-leads .lead-status-col .badge-cyan { background: #e6f8fc; color: #029ab8; }
#page-leads .lead-status-col .badge-navy { background: #ebf4f9; color: #537f98; }
#page-leads .lead-status-col :is(.badge-success, .badge-green) { background: #e5f8ef; color: #0a9b73; }
#page-leads .lead-status-col .badge-warning { background: #fff6e5; color: #b18435; }
#page-leads .lead-status-col .badge-purple { background: #f1edfc; color: #8b71b8; }
#page-leads .lead-status-col :is(.badge-danger, .badge-red) { background: #fff0ef; color: #bd7975; }
#page-leads .lead-status-col .badge-converted { background: #fff5df; color: #9d7a38; border-color: #f1e4c5; }
#page-leads .lead-health-btn { width: 26px; height: 26px; border-color: #d6e6ec; background: #fff; color: #92aab8; font-size: 13px; box-shadow: none; }
#page-leads .lead-health-btn:hover { border-color: #a1ddcc; background: #effbf6; color: #00a484; transform: none; }
#page-leads .lead-health-btn.active { border-color: #b8ead9; background: #e5f9f0; color: #00a484; box-shadow: none; }
#page-leads .lead-health-expiry { color: #528b76; font-size: 9px; font-weight: 500; }
#page-leads .lead-task-count { display: inline-flex; align-items: baseline; justify-content: center; gap: 2px; direction: ltr; min-width: 36px; color: #527487; font-size: 11px; font-variant-numeric: tabular-nums; }
#page-leads .lead-task-count strong { color: #009dbd; font-size: 13px; }
#page-leads .lead-expand-btn { display: inline-grid; place-items: center; width: 26px; height: 26px; min-width: 26px; border-color: #cbe5ee; border-radius: 8px; background: #edf9fc; color: #078daa; box-shadow: none; }
#page-leads .lead-expand-icon { width: 15px; height: 15px; }
#page-leads .lead-expand-btn:hover:not(:disabled) { border-color: #b5dfea; background: #e9f8fc; color: #009dc0; }
#page-leads .lead-expand-btn.open { border-color: #b2e5ec; background: #e6f8fb; color: #009fba; }
#page-leads .lead-expand-btn:disabled { background: #f8fbfd; border-color: #eaf1f5; color: #bacbd5; }
#page-leads .lead-group-header-row > td { padding: 6px 16px; background: #f4fafd; border-top: 1px solid #e5f0f5; border-bottom: 1px solid #e5f0f5; }
#page-leads .leads-group-label { display: inline-flex; align-items: center; gap: 8px; color: #486b80; font-size: 11px; font-weight: 600; }
#page-leads .leads-group-dot { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #00afd0; }
#page-leads .leads-group-count { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; padding: 2px 7px; margin-inline-start: 8px; border: 1px solid #dcecf3; border-radius: 20px; background: #fff; color: #58758a; font-size: 10px; font-variant-numeric: tabular-nums; }
#page-leads .lead-group-header-row[data-group="handled"] > td { background: #f4faf7; border-color: #e7f1eb; }
#page-leads .lead-group-header-row[data-group="handled"] .leads-group-dot { background: #00b99d; }
#page-leads .lead-group-header-row[data-group="handled"] .leads-group-label { color: #4d7b69; }
#page-leads .lead-inline-details-row > td { padding: 0; background: #f9fcfe; }
#page-leads .lead-inline-details { margin: 0 22px 0 18px; padding: 18px 18px 18px 0; border-right: 2px solid #ceecf5; }
#page-leads .lead-inline-section-title { color: #3f647a; font-size: 12px; font-weight: 600; }
#page-leads .lead-inline-section-count { min-width: 22px; height: 22px; color: #397b94; background: #eef9fc; border-color: #d9edf5; font-size: 10px; font-weight: 500; }
#page-leads :is(.lead-inline-agreement, .project-inline-task) { background: #fff; border-color: #e5eef4; border-radius: 9px; box-shadow: none; padding: 11px 14px; }
#page-leads :is(.lead-inline-agreement, .project-inline-task):hover { background: #f5fbfd; border-color: #cae8f1; box-shadow: none; }
#page-leads :is(.lead-inline-agreement-title, .project-inline-task-title) { color: var(--leads-ink); font-size: 12px; font-weight: 600; }
#page-leads :is(.lead-inline-agreement-desc, .project-inline-task-desc) { color: var(--leads-muted); font-size: 11px; }
@container leads-page (max-width: 1050px) {
  #page-leads .task-filter-panel,
  #page-leads .task-filter-panel:has([data-admin-scope-filter]:not([hidden])) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #page-leads .leads-search-field { grid-column: span 2; }
  #page-leads .leads-filter-reset { grid-column: 4; }
}
@container leads-page (max-width: 680px) {
  #page-leads .task-filter-panel,
  #page-leads .task-filter-panel:has([data-admin-scope-filter]:not([hidden])) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #page-leads .leads-search-field,
  #page-leads [data-admin-scope-filter] { grid-column: 1 / -1; }
  #page-leads .leads-filter-reset { grid-column: 2; }
  #page-leads .leads-filter-card { padding: 12px 18px; }
  #page-leads .leads-table-card > .leads-section-heading { padding: 12px 18px; flex-wrap: wrap; gap: 6px 14px; }
}
@media (max-width: 760px) {
  #page-leads { padding: 14px 12px 24px; }
  #page-leads .leads-create-action { padding: 9px 13px; min-height: 40px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  #page-leads, #page-leads *, #page-leads *::before, #page-leads *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
