/* ==========================================================================
   Shared filters: date range, calendar picker, row actions
   ========================================================================== */

/* ---------- Date range control ---------- */
.rf { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rf-ic { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.rf-ic svg { width: 16px; height: 16px; }
.rf-sel { min-width: 148px; }
.rf-date { height: 32px; width: 148px; font-size: 12.5px; padding: 0 30px 0 10px; border-radius: 8px; }
.rf-to { font-size: 12px; color: var(--text-3); }

/* Filter strip above a list: groups wrap neatly instead of squeezing. */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.filters .grow { flex: 1 1 auto; }
.filters-clear { font-size: 12.5px; font-weight: 600; color: var(--primary-strong); padding: 0 6px; height: 32px; }
.filters-clear:hover { text-decoration: underline; }

/* ---------- Date inputs: our own calendar icon (the browser's is hidden) ---------- */
input[type="date"] { position: relative; cursor: pointer; }
input[type="date"]::-webkit-calendar-picker-indicator { opacity: 0; position: absolute; right: 0; top: 0; width: 100%; height: 100%; cursor: pointer; }
@media (hover: hover) and (pointer: fine) {
  input[type="date"]::-webkit-calendar-picker-indicator { display: none; }
  input[type="date"] {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238b7fb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M8 3v4M16 3v4M3 10h18'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
  }
}

/* ---------- Calendar ---------- */
.dp {
  position: fixed; z-index: 120; width: 292px; padding: 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 18px;
  box-shadow: var(--shadow-lg); animation: dpIn 160ms var(--ease-out);
  user-select: none; -webkit-user-select: none;
}
.dp.closing { opacity: 0; transform: translateY(-4px); transition: opacity 120ms, transform 120ms; }
@keyframes dpIn { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.dp-head { display: flex; align-items: center; gap: 2px; margin-bottom: 8px; }
.dp-head b { flex: 1; text-align: center; font-size: 13.5px; font-weight: 650; letter-spacing: -.01em; }
.dp-nav { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; line-height: 1; color: var(--text-2); display: grid; place-items: center; transition: background var(--t-fast), color var(--t-fast); }
.dp-nav:hover { background: var(--surface-3); color: var(--text); }
.dp-wk, .dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.dp-wk span { text-align: center; font: 600 10.5px var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); padding: 4px 0 6px; }
.dp-grid { gap: 2px; }
.dp-d { height: 34px; border-radius: 10px; font-size: 13px; font-weight: 550; color: var(--text); font-variant-numeric: tabular-nums; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.dp-d:hover { background: var(--primary-soft); color: var(--primary-strong); }
.dp-d:active { transform: scale(.92); }
.dp-d.out { color: var(--text-3); opacity: .55; }
.dp-d.today { box-shadow: inset 0 0 0 1.5px var(--primary-ring); }
.dp-d.sel, .dp-d.sel:hover { background: var(--grad-brand, linear-gradient(135deg, #7c3aed, #a78bfa)); color: #fff; box-shadow: 0 6px 16px -6px rgba(124, 58, 237, .7); opacity: 1; }
.dp-foot { display: flex; justify-content: space-between; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.dp-foot button { height: 30px; padding: 0 10px; border-radius: 8px; font-size: 12.5px; font-weight: 600; color: var(--primary-strong); }
.dp-foot button:hover { background: var(--primary-soft); }

/* ---------- Row actions: always visible, quiet until you reach for them ---------- */
.row-acts { display: inline-flex; align-items: center; gap: 2px; }
.ra { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--text-3); transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast); }
.ra svg { width: 15px; height: 15px; }
.ra:hover { background: var(--surface-3); color: var(--text); }
.ra:active { transform: scale(.92); }
.ra-del:hover { background: var(--danger-soft, rgba(244, 63, 94, .14)); color: var(--danger); }
th.ra-col { width: 76px; }
td.ra-col { text-align: right; white-space: nowrap; }
/* On cards the buttons sit in the corner */
.tcard .row-acts, .client-card .row-acts { margin: -4px -6px -4px 0; }

/* ---------- Expenses: summary cards ---------- */
.exp-kpis .kpi-value { font-size: 26px; }
.exp-kpis .kpi-value.txt { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.kpi-sub { font-size: 12.5px; color: var(--text-2); }
.exp-bar { height: 6px; border-radius: 6px; background: var(--surface-3); overflow: hidden; margin-top: 10px; }
.exp-bar > span { display: block; height: 100%; border-radius: 6px; background: var(--grad-brand, linear-gradient(90deg, #7c3aed, #a78bfa)); }
.exp-bar.over > span { background: var(--danger); }

/* Sections that sit one above the other must never touch. */
.lead-row, .exp-row { margin-bottom: 18px; }

@media (max-width: 760px) {
  .rf { width: 100%; }
  .rf-sel { flex: 1 1 auto; min-width: 0; }
  .rf-date { flex: 1 1 0; min-width: 0; width: auto; font-size: 16px; height: 40px; }
  .rf-to { display: none; }
  .filters { gap: 8px; }
  .filters .select-sm, .filters .search-in { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .filters .search-in { flex-basis: 100%; }
  .ra { width: 36px; height: 36px; }
  td.ra-col { grid-column: 1 / -1; text-align: right; }
}

/* ---------- Client: automations built ---------- */
.auto-list { display: grid; gap: 6px; margin-bottom: 10px; }
.auto-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.auto-row .auto-text { flex: 1; min-width: 0; font-size: 13.5px; font-weight: 550; overflow-wrap: anywhere; }
.auto-row.done .auto-text { color: var(--text-3); text-decoration: line-through; }
.auto-row .ra { flex-shrink: 0; }
.auto-add { display: flex; gap: 8px; }
.auto-add .input { flex: 1; min-width: 0; }
.check-line { display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; font-size: 13.5px; font-weight: 550; }
.check-line input { width: 18px; height: 18px; accent-color: var(--primary); flex-shrink: 0; }
/* ---------- Payment reminders (admin) ---------- */
.pa-block { margin-bottom: 14px; }
.pa-block > b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.pa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pa-chip { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 4px 0 12px; border-radius: 999px; background: var(--primary-soft); border: 1px solid var(--primary-ring); color: var(--primary-strong); font-size: 13px; font-weight: 600; }
.pa-chip button { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: var(--primary-strong); }
.pa-chip button:hover { background: var(--surface-3); }
.pa-chip svg { width: 14px; height: 14px; }
.pa-add { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.pa-add .input { width: 110px; }
/* ---------- Notifications: recent alerts + help ---------- */
.nt-recent { margin: 16px 0 4px; }
.nt-recent > b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 8px; }
.nt-r { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 12px; padding: 9px 0; border-top: 1px solid var(--border); font-size: 12.5px; }
.nt-when { color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }
.nt-what { font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.nt-st { grid-column: 2; font-size: 11.5px; color: var(--text-3); }
.nt-st.ok { color: var(--success, #10b981); }
.nt-st.bad { color: var(--danger); }
.nt-help { margin: 12px 0 4px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.nt-help summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 600; color: var(--primary-strong); list-style: none; }
.nt-help summary::-webkit-details-marker { display: none; }
.nt-help ol { margin: 0; padding: 0 16px 6px 34px; font-size: 12.5px; line-height: 1.6; color: var(--text-2); display: grid; gap: 6px; }
.nt-help .nt-fine { padding: 0 14px 12px; margin-top: 4px; }
/* ==========================================================================
   Lead import wizard, imported-details panel, paging
   ========================================================================== */
.modal.li-wide { width: min(720px, calc(100vw - 32px)); }
.li-drop { display: grid; justify-items: center; gap: 8px; text-align: center; padding: 34px 20px; border: 2px dashed var(--border-strong); border-radius: 18px; background: var(--surface-2); cursor: pointer; transition: border-color var(--t-fast), background var(--t-fast); }
.li-drop:hover, .li-drop.over { border-color: var(--primary); background: var(--primary-soft); }
.li-drop-ic { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--primary-soft); color: var(--primary); }
.li-drop-ic svg { width: 24px; height: 24px; }
.li-drop b { font-size: 15px; font-weight: 650; }
.li-drop small { font-size: 12.5px; color: var(--text-3); max-width: 420px; line-height: 1.5; }
.li-sec { margin: 18px 0 8px; font: 600 10.5px var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.li-old { display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-bottom: 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.li-old > div { min-width: 0; display: grid; }
.li-old b { font-size: 13px; font-weight: 600; }
.li-old span { font-size: 12px; }
.li-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.li-tiles > div { padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); }
.li-tiles b { display: block; font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.li-tiles span { font-size: 12px; color: var(--text-3); line-height: 1.35; display: block; }
.li-sheet { padding: 12px 14px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 14px; }
.li-sheet > b { font-size: 13.5px; }
.li-maps { display: flex; flex-wrap: wrap; gap: 6px; }
.li-map { font-size: 11.5px; padding: 3px 9px; border-radius: 8px; background: var(--primary-soft); color: var(--text-2); overflow-wrap: anywhere; }
.li-map b { color: var(--primary-strong); font-weight: 650; }
.li-kept { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.li-kept svg { width: 16px; height: 16px; margin-top: 2px; color: var(--success, #10b981); }
.li-busy { display: flex; align-items: center; gap: 12px; padding: 28px 4px; color: var(--text-2); }
.li-busy i { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--primary-ring); border-top-color: var(--primary); animation: liSpin 700ms linear infinite; }
@keyframes liSpin { to { transform: rotate(360deg); } }
.li-bar { height: 10px; border-radius: 10px; background: var(--surface-3); overflow: hidden; margin: 10px 0 14px; }
.li-bar span { display: block; height: 100%; border-radius: 10px; background: var(--grad-brand); transition: width 220ms var(--ease); }
.li-count { font-size: 14px; color: var(--text-2); }
.li-count b { color: var(--text); font-variant-numeric: tabular-nums; }
.modal.li-wide .modal-body { max-height: calc(100vh - 220px); }

/* ---- what the sheet had for one lead ---- */
.ld-sec { margin-bottom: 12px; }
.ld-sec > b { display: block; margin-bottom: 4px; font-size: 12.5px; font-weight: 650; }
.ld-p { font-size: 13px; line-height: 1.55; color: var(--text-2); overflow-wrap: anywhere; }
.ld-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 13px; line-height: 1.55; color: var(--text-2); }
.ld-links { display: flex; flex-wrap: wrap; gap: 6px; }
.ld-chip { display: inline-flex; gap: 6px; align-items: center; max-width: 100%; padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); font-size: 12px; color: var(--text-3); text-transform: capitalize; }
.ld-link { color: var(--primary-strong); text-decoration: underline; overflow-wrap: anywhere; text-transform: none; }
.ld-more { margin-bottom: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); overflow: hidden; }
.ld-more summary { cursor: pointer; padding: 11px 14px; font-size: 13px; font-weight: 600; list-style: none; }
.ld-more summary::-webkit-details-marker { display: none; }
.ld-more summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--text-3); transition: transform var(--t-fast); }
.ld-more[open] summary::before { transform: rotate(90deg); }
.ld-kv { display: grid; }
.ld-kv > div { display: grid; grid-template-columns: minmax(90px, 36%) minmax(0, 1fr); gap: 10px; padding: 7px 14px; border-top: 1px solid var(--border); font-size: 12.5px; }
.ld-kv span { color: var(--text-3); text-transform: capitalize; overflow-wrap: anywhere; }
.ld-kv b { font-weight: 500; overflow-wrap: anywhere; white-space: pre-wrap; }
.ld-also { padding: 8px 0 4px; border-top: 1px solid var(--border); }
.ld-also > .faint { padding: 0 14px; }

/* ---- big lists ---- */
.col-more { width: 100%; height: 38px; margin-top: 8px; border: 1px dashed var(--border-strong); border-radius: 12px; font-size: 12.5px; font-weight: 600; color: var(--primary-strong); }
.col-more small { font-weight: 500; color: var(--text-3); }
.col-more:hover { background: var(--primary-soft); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--border); }

@media (max-width: 760px) {
  .li-tiles b { font-size: 20px; }
  .li-tiles > div { padding: 12px 10px; }
  .modal.li-wide .modal-foot { flex-wrap: wrap; }
  .ld-kv > div { grid-template-columns: 1fr; gap: 2px; }
}
/* ==========================================================================
   The lead sheet and call mode
   ========================================================================== */
.ld-bar { align-items: center; }
.ld-bar .chips { flex: 0 1 auto; }
.chip-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }

/* ---- the sheet: Lead pinned on the left, the heading row pinned on top, everything else scrolls ---- */
.ldsheet { border: 1px solid var(--border); border-radius: 18px; background: var(--surface); overflow: hidden; margin-bottom: 18px; }
.ldsheet-scroll { overflow: auto; max-height: calc(100vh - 270px); min-height: 340px; overscroll-behavior: contain; }
.ldsheet-table { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 13px; }
.ldsheet-table th, .ldsheet-table td { padding: 10px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.ldsheet-table th:last-child, .ldsheet-table td:last-child { border-right: 0; }
.ldsheet-table thead th { position: sticky; top: 0; z-index: 3; height: 42px; vertical-align: middle; white-space: nowrap; font: 600 10.5px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); background: var(--surface-2); user-select: none; -webkit-user-select: none; }
.ldsheet-table thead th[draggable="true"] { cursor: grab; }
.ldsheet-table thead th[draggable="true"]:active { cursor: grabbing; }
.ldsheet-table thead th > span { overflow: hidden; text-overflow: ellipsis; }
.ldsheet-table th svg { width: 12px; height: 12px; margin-right: 6px; vertical-align: -1px; }
.grip { display: inline-block; width: 8px; height: 12px; margin-right: 8px; vertical-align: -2px; opacity: .55;
  background: radial-gradient(circle, currentColor 1.2px, transparent 1.6px) 0 0 / 4px 4px; }
.ldsheet-table th:first-child, .ldsheet-table td:first-child { position: sticky; left: 0; z-index: 2; box-shadow: 1px 0 0 var(--border); }
.ldsheet-table thead th:first-child { z-index: 4; }
.ldsheet-table tbody tr { cursor: pointer; }
.ldsheet-table tbody tr:hover td { background: linear-gradient(color-mix(in srgb, var(--primary-soft) 55%, transparent), color-mix(in srgb, var(--primary-soft) 55%, transparent)), var(--surface); }
.ldsheet-table th.drop-before { box-shadow: inset 3px 0 0 var(--primary); }
.ldsheet-table th.drop-after { box-shadow: inset -3px 0 0 var(--primary); }
.ldsheet-table .sh-act { text-align: right; white-space: nowrap; padding: 6px 8px; }
.ldsheet-table .sh-act .row-acts { display: inline-flex; }
.sh-name { display: block; font-weight: 620; font-size: 13.5px; overflow-wrap: anywhere; }
.sh-sub { font-size: 12px; margin-top: 2px; overflow-wrap: anywhere; }
.cell-clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.5; color: var(--text-2); overflow-wrap: anywhere; }
.ldsheet-table a { color: var(--primary-strong); text-decoration: none; overflow-wrap: anywhere; }
.ldsheet-table a:hover { text-decoration: underline; }
.ld-tel { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-sel { height: 30px; max-width: 100%; padding: 0 26px 0 10px; border-radius: 999px; font: 600 12.5px var(--font); color: var(--text); cursor: pointer;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); background-color: color-mix(in srgb, var(--c) 16%, transparent); }
.st-sel:focus-visible { outline: 2px solid var(--primary-ring); }
.cols-pop { min-width: 270px; padding-bottom: 8px; }
.colrow { display: flex; align-items: center; gap: 4px; padding: 3px 8px 3px 12px; font-size: 13px; }
.colrow label { flex: 1; display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px 0; }
.colrow input { width: 16px; height: 16px; accent-color: var(--primary); }
.colrow.locked { color: var(--text-3); gap: 9px; padding: 8px 12px; }
.colrow.locked svg { width: 14px; height: 14px; }
.colrow .ra { width: 26px; height: 26px; font-size: 13px; }

/* ---- call mode ---- */
.modal.call-wide { width: min(780px, calc(100vw - 32px)); }
.modal.call-wide .modal-body { max-height: calc(100vh - 200px); }
.lc-name2 { font-size: 22px; font-weight: 720; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 4px; overflow-wrap: anywhere; }
.lc-contact { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 14px 0 6px; }
.lc-call { display: inline-flex; align-items: center; gap: 10px; height: 52px; padding: 0 22px; border-radius: 16px; background: var(--grad-brand); color: #fff; font-size: 19px; box-shadow: 0 10px 24px -10px rgba(124, 58, 237, .8); text-decoration: none; }
.lc-call svg { width: 20px; height: 20px; }
.lc-call b { font-weight: 700; letter-spacing: .01em; font-variant-numeric: tabular-nums; }
.lc-link { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--primary-strong); text-decoration: none; overflow-wrap: anywhere; }
.lc-link svg { width: 15px; height: 15px; flex-shrink: 0; }
.lc-research { margin-top: 12px; }
.lc-hook { margin-bottom: 14px; }
.lc-hook .notes-box { font-size: 14.5px; line-height: 1.6; }
.lc-stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.lc-st { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 58px; padding: 8px 6px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; text-align: center; line-height: 1.2; transition: transform var(--t-fast), border-color var(--t-fast), background var(--t-fast); }
.lc-st kbd { font: 600 10px var(--mono); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--border); color: var(--text-3); }
.lc-st:hover { border-color: color-mix(in srgb, var(--c) 60%, transparent); }
.lc-st:active { transform: scale(.97); }
.lc-st.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 20%, var(--surface)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 22%, transparent); }
.modal.call-wide .modal-foot .btn-primary { min-width: 170px; justify-content: center; }
.field .hint { display: block; margin-top: 5px; font-size: 11.5px; color: var(--text-3); }
/* The Columns menu is pinned to the screen, so on a short window it must scroll by itself. */
.cols-pop { max-height: min(72vh, calc(100vh - 150px)); overflow-y: auto; overscroll-behavior: contain; }
.colrow .ra svg { width: 14px; height: 14px; }

/* Call back: date, time and the zone the time is in, with a line saying what it means for you. */
.cb { display: grid; gap: 8px; }
.cb-row { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.05fr) minmax(0, 1.4fr); gap: 8px; }
.cb-row .input, .cb-row .select { width: 100%; min-width: 0; padding-inline: 10px; font-size: 13px; }
.cb-note { font-size: 12.5px; line-height: 1.5; color: var(--text-2); min-height: 18px; }
.cb-note a { color: var(--primary-strong); }
@media (max-width: 560px) { .cb-row { grid-template-columns: 1fr 1fr; } .cb-row select { grid-column: 1 / -1; } }

/* Ticking leads (admins): a box beside each name, and a bar to hand the ticked ones to someone. */
.sh-cell { display: flex; align-items: flex-start; gap: 10px; }
.sh-who { min-width: 0; flex: 1; }
.sh-ck { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; width: 22px; height: 22px; margin: -2px 0 0 -4px; cursor: pointer; }
.sh-ck input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.ldsheet-table th.locked .sh-ck { margin: 0 6px 0 -4px; vertical-align: -5px; }
/* The tint sits on top of a solid colour, so the pinned Lead column never lets the columns scrolling under it show through. */
.ldsheet-table tbody tr.sel td { background: linear-gradient(var(--primary-soft), var(--primary-soft)), var(--surface); }
.sel-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 10px 14px; margin: 0 0 12px; border-radius: 14px; border: 1px solid var(--primary-ring); background: var(--primary-soft); animation: popIn 220ms var(--ease-out); }
.sel-bar .grow { flex: 1 1 20px; }
.sel-bar .select { min-width: 170px; }
@media (max-width: 560px) { .sel-bar .select, .sel-bar .btn { flex: 1 1 100%; } }

/* The grouped Industry list has long group names; keep the box the size of the other filters. */
#ldInd { max-width: 230px; }
/* First call and the next follow-up, side by side in the lead panel */
.ld-dates { display: grid; grid-template-columns: 1fr; gap: 4px; }

@media (max-width: 760px) {
  .ldsheet-scroll { max-height: 68vh; overscroll-behavior-x: auto; touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
  /* On a phone the pinned Lead column ate most of the screen, leaving no room to swipe sideways.
     Here the name scrolls with the rest of the row; only the heading row stays pinned on top. */
  .ldsheet-table td:first-child { position: static; box-shadow: none; }
  .ldsheet-table th:first-child { left: auto; box-shadow: none; }
  .ldsheet-table th[draggable="true"] { -webkit-user-drag: none; }

  /* Filters: every control the same width, lined up in two tidy columns. */
  #ldInd { max-width: none; flex: 1 1 100%; }
  .ld-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .ld-bar .chips { grid-column: 1 / -1; }
  .ld-bar .btn, .ld-bar .seg { width: 100%; min-height: 42px; }
  .ld-bar .grow { display: none; }
  .ld-bar .seg { grid-column: 1 / -1; }
  .ld-bar .seg button { flex: 1 1 0; justify-content: center; }
  .ld-bar [data-callmode]:only-of-type, .ld-bar [data-callmode]:nth-last-child(2) { grid-column: 1 / -1; }

  /* The sheet becomes a list of cards on a phone: no sideways scrolling, nothing pinned, nothing cut off.
     Each card is one lead; every column you have switched on is a labelled line inside it. */
  .ldsheet-scroll { max-height: none; min-height: 0; overflow: visible; }
  .ldsheet-table, .ldsheet-table tbody { display: block; width: 100% !important; }
  .ldsheet-table colgroup, .ldsheet-table thead { display: none; }
  .ldsheet-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; position: relative; padding: 14px 14px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
  .ldsheet-table tbody tr.sel { background: linear-gradient(var(--primary-soft), var(--primary-soft)), var(--surface); }
  .ldsheet-table tbody tr:hover td, .ldsheet-table tbody tr.sel td, .ldsheet-table td { background: transparent; }
  .ldsheet-table td { display: block; min-width: 0; padding: 0; border: 0; overflow: visible; }
  .ldsheet-table td.nil { display: none; }
  .ldsheet-table td[data-l]::before { content: attr(data-l); display: block; margin-bottom: 3px; font: 600 10px var(--mono); letter-spacing: .09em; text-transform: uppercase; color: var(--text-3); }
  .ldsheet-table td[data-c="name"] { grid-column: 1 / -1; padding-right: 96px; }
  .ldsheet-table td[data-c="name"]::before { display: none; }
  .ldsheet-table td[data-c="email"], .ldsheet-table td[data-c="website"], .ldsheet-table td[data-c="desc"], .ldsheet-table td[data-c="pain"], .ldsheet-table td[data-c="opps"],
  .ldsheet-table td[data-c="hook"], .ldsheet-table td[data-c="services"], .ldsheet-table td[data-c="notes"], .ldsheet-table td[data-c="source"], .ldsheet-table td[data-c="industry"],
  .ldsheet-table td[data-c="location"], .ldsheet-table td[data-c="followUp"] { grid-column: 1 / -1; }
  .ldsheet-table td.sh-act { position: absolute; top: 8px; right: 6px; padding: 0; text-align: right; }
  .ldsheet-table .st-sel { width: 100%; }
  .ldsheet-table .cell-clamp { -webkit-line-clamp: 3; }
  .ld-bar .chips { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .ld-bar .btn, .ld-bar .seg { flex: 1 1 auto; justify-content: center; }
  .lc-stages { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lc-st kbd { display: none; }
  .lc-call { width: 100%; justify-content: center; }
  .lc-name2 { font-size: 19px; }
  .modal.call-wide .modal-foot .btn-primary { flex: 1 1 100%; }
}
/* Projects inside the client form: name, price, how charged, start date, remove. */
.pj-rows { display: grid; gap: 8px; margin-bottom: 8px; }
.pj-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr) auto; gap: 8px; align-items: center; }
.pj-row .input, .pj-row .select { width: 100%; min-width: 0; }
@media (max-width: 640px) { .pj-row { grid-template-columns: 1fr 1fr; } .pj-row [data-k="name"] { grid-column: 1 / -1; } .pj-row .icon-btn { justify-self: end; } }

/* Project cards in the client form (these rules replace the cramped one-line row above). */
.pj-rows { gap: 12px; }
.pj-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; align-items: end; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface-2); position: relative; }
.pj-name { grid-column: 1 / -1; padding-right: 40px; }
.pj-inc { grid-column: 1 / -1; }
.pj-f { min-width: 0; }
.pj-f label { display: block; margin-bottom: 5px; font-size: 12px; font-weight: 600; color: var(--text-2); }
.pj-f .textarea { min-height: 64px; }
.pj-x { position: absolute; top: 14px; right: 12px; }
@media (max-width: 640px) { .pj-row { grid-template-columns: 1fr 1fr; } .pj-row .pj-f:nth-of-type(4) { grid-column: 1 / -1; } }

/* Package items inside a project card: one input per item. */
.pj-item { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.pj-item .input { flex: 1; min-width: 0; }
