/* Sales and requests lists (sales-list-kit.js): column widths, designed states and the detail dialog.
   Tokens only, so light and dark both follow the page. Table look itself comes from hl-list.css. */

/* The first column of these tables is a title, not a number: no mono, and it gets the room. */
html body table.hl-lt[data-hl-table^="sl-"] td.c-number .hl-main { font-family: inherit; }
html body table.hl-lt[data-hl-table^="sl-"] .c-number { width: 22%; }
html body table.hl-lt[data-hl-table^="sl-"] .c-client { width: 22%; }
html body table.hl-lt[data-hl-table^="sl-"] .c-property { width: 17%; }
html body table.hl-lt[data-hl-table^="sl-"] .c-source { width: 136px; }
html body table.hl-lt[data-hl-table^="sl-"] .c-assigned { width: 120px; }
html body table.hl-lt[data-hl-table^="sl-"] .c-status { width: 176px; }
html body table.hl-lt[data-hl-table^="sl-"] .c-total { width: 96px; }
html body table.hl-lt[data-hl-table^="sl-"] .c-created, html body table.hl-lt[data-hl-table^="sl-"] .c-sent, html body table.hl-lt[data-hl-table^="sl-"] .c-age { width: 112px; }
html body table.hl-lt[data-hl-table^="sl-"] .c-job { width: 20%; }
html body table.hl-lt[data-hl-table^="sl-"] .c-kind { width: 132px; }
html body table.hl-lt[data-hl-table^="sl-"] .c-quick { width: 168px; overflow: visible; }
html body table.hl-lt[data-hl-table^="sl-"] .c-detail { width: 22%; }
html body table.hl-lt[data-hl-table^="sl-"] .c-what, html body table.hl-lt[data-hl-table^="sl-"] .c-reason { width: 18%; }
html body table.hl-lt[data-hl-table^="sl-"] .c-phone { width: 140px; }
html body table.hl-lt[data-hl-table^="sl-"] td.c-what, html body table.hl-lt[data-hl-table^="sl-"] td.c-reason, html body table.hl-lt[data-hl-table^="sl-"] td.c-phone { color: var(--mut); font-weight: 500; }
html body table.hl-lt[data-hl-table^="sl-"] td.c-source, html body table.hl-lt[data-hl-table^="sl-"] td.c-assigned, html body table.hl-lt[data-hl-table^="sl-"] td.c-age, html body table.hl-lt[data-hl-table^="sl-"] td.c-job, html body table.hl-lt[data-hl-table^="sl-"] td.c-kind { color: var(--mut); font-weight: 500; }
html body table.hl-lt[data-hl-table^="sl-"] td.c-job .hl-main { color: var(--ink); font-weight: 600; }
html body table.hl-lt td.c-quick { text-align: right; }
/* Compact is one line a row: the second line of a cell (its sub) shows in Comfortable. */
html[data-hl-density="compact"] body table.hl-lt[data-hl-table^="sl-"] .hl-sub { display: none; }
html body .hl-pill-f input { border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 800; height: 100%; padding: 0 6px 0 0; outline: none; }
html body table.hl-lt .sk-quick { display: inline-flex; gap: 6px; align-items: center; }
html body table.hl-lt .sk-none { color: var(--mut); font-weight: 500; }
html body table.hl-lt .sk-warn { color: var(--red); font-weight: 700; }

/* Phone: title and amount on the first line, who and status on the second, buttons on a third. */
@media (max-width: 700px) {
  html body table.hl-lt[data-hl-table^="sl-"] tbody tr { grid-template-columns: minmax(0, 1fr) minmax(0, auto) 40px; grid-template-areas: "num total act" "client status act"; row-gap: 3px; padding: 8px 4px 8px 12px; }
  html body table.hl-lt[data-hl-table^="sl-approvals-"]:not([data-hl-table$="timeoff"]) tbody tr { grid-template-columns: 34px minmax(0, 1fr) minmax(0, auto) 40px; grid-template-areas: "pick num total act" "pick client status act"; padding-left: 4px; }
  html body table.hl-lt[data-hl-table^="sl-"] tbody tr:has(td.c-quick) { grid-template-areas: "num total act" "client status act" "quick quick act"; }
  html body table.hl-lt[data-hl-table^="sl-approvals-"]:not([data-hl-table$="timeoff"]) tbody tr:has(td.c-quick) { grid-template-areas: "pick num total act" "pick client status act" "pick quick quick act"; }
  html body table.hl-lt[data-hl-table^="sl-"] td.c-quick { display: block !important; grid-area: quick; text-align: left; margin-top: 4px; }
  html body table.hl-lt[data-hl-table^="sl-"] td.c-status { justify-self: end; max-width: 150px; }
  html body table.hl-lt[data-hl-table^="sl-"] td.c-pick { grid-area: pick; align-self: start; padding-top: 2px; }
  html body table.hl-lt[data-hl-table^="sl-"] td.c-client { white-space: nowrap; }
  html body table.hl-lt[data-hl-table^="sl-"] td.c-number .hl-main { font-size: var(--hl-fs-body); }
  html body table.hl-lt[data-hl-table^="sl-"] td.c-number .hl-sub { display: none; }
}

/* Touch targets on a phone. */
@media (max-width: 700px) { html body table.hl-lt .sk-quick .hl-btn { min-height: 44px; padding: 0 16px; } }

/* Phone toolbar: one scrolling row instead of five stacked rows. */
@media (max-width: 700px) {
  html body .sk-block .hl-tb .hl-tb-end { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  html body .sk-block .hl-tb .hl-tb-end::-webkit-scrollbar { display: none; }
  html body .sk-block .hl-tb .hl-tb-end > * { flex: none; }
  html body .sk-block .hl-tb .hl-tb-chips { padding-bottom: 2px; }
}

/* Designed empty / error card: dashed, calm, on the page's own surface. */
html body .sk-state { text-align: center; padding: 40px 20px; color: var(--ink); overflow-wrap: anywhere; box-sizing: border-box; }
html body .sk-state.err { color: var(--ink); }
html body .sk-state-t { font-size: 16px; font-weight: 700; color: var(--ink); }
html body .sk-state-s { font-size: var(--hl-fs-body); font-weight: 500; line-height: 1.45; color: var(--mut); margin: 6px auto 0; max-width: 440px; }
html body .sk-state-a { margin-top: 14px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
html body .sk-state.err .sk-state-t { color: var(--red); }

/* List / Board switch on the Leads screen */
html body .sk-switch { display: inline-flex; border: 1px solid var(--line); border-radius: var(--hl-r); background: var(--card); padding: 2px; gap: 2px; flex: none; }
html body .sk-switch button { font: inherit; font-size: var(--hl-fs-micro); font-weight: 700; color: var(--mut); background: transparent; border: 0; border-radius: 7px; padding: 0 12px; height: calc(var(--hl-h-sm) - 4px); min-height: 24px; cursor: pointer; }
html body .sk-switch button[aria-pressed="true"] { background: var(--ink); color: var(--card); }
html body .sk-switch button:focus-visible { outline: 2px solid var(--hl-primary); outline-offset: 1px; }
html body .sk-hide { display: none !important; }
html body .sk-block { min-width: 0; }
html body .sk-lead-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
html body .sk-lead-head .sk-grow { flex: 1; }

/* Detail dialog */
html body .sk-scrim { position: fixed; inset: 0; z-index: 9900; background: rgba(15, 20, 32, .5); display: flex; align-items: center; justify-content: center; padding: 16px; }
html body .sk-sheet { background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--hl-pop); width: 100%; max-width: 520px; max-height: 100%; display: flex; flex-direction: column; overflow: hidden; }
html body .sk-sheet-h { display: flex; align-items: flex-start; gap: 10px; padding: 16px 16px 12px; border-bottom: 1px solid var(--line); }
html body .sk-sheet-t { flex: 1; min-width: 0; }
html body .sk-sheet-t h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
html body .sk-sheet-t p { margin: 3px 0 0; font-size: var(--hl-fs-body); color: var(--mut); overflow-wrap: anywhere; }
html body .sk-sheet-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--mut); font-size: 22px; line-height: 1; cursor: pointer; }
html body .sk-sheet-x:hover { background: var(--gold-bg); color: var(--ink); }
html body .sk-sheet-b { padding: 14px 16px; overflow-y: auto; }
html body .sk-facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 8px 12px; margin: 0; }
html body .sk-facts dt { font-size: var(--hl-fs-micro); font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--mut); padding-top: 2px; }
html body .sk-facts dd { margin: 0; font-size: var(--hl-fs-body); color: var(--ink); overflow-wrap: anywhere; }
html body .sk-sheet-body { margin-top: 12px; font-size: var(--hl-fs-body); line-height: 1.5; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
html body .sk-sheet-note { margin: 12px 0 0; font-size: var(--hl-fs-micro); color: var(--mut); }
html body .sk-sheet-f { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 16px 16px; border-top: 1px solid var(--line); }
@media (max-width: 700px) { html body .sk-facts { grid-template-columns: 96px minmax(0, 1fr); } html body .sk-sheet-f .hl-btn { flex: 1 1 auto; } }

/* Change order detail: the standing lines and the inline reject / payment forms live in the dialog now. */
html body .sk-sheet .co-standing { font-size: var(--hl-fs-body); font-weight: 600; line-height: 1.6; color: var(--ink); margin: 0; }
html body.hl-dark .sk-sheet .co-standing [style*="color:#047857"] { color: #5ccf9b !important; }
html body.hl-dark .sk-sheet .co-standing [style*="color:#b91c1c"] { color: #f19a90 !important; }
html body .sk-sheet :is(input, select, textarea) { background: var(--card) !important; color: var(--ink); }
html body .sk-sheet-body:has(.co-standing) { white-space: normal; margin-top: 0; }

/* From the field: the wide table version of the Sales inbox, on the app's own theme. */
html body .sh-root.sh-wide { background: var(--canvas, #f0f1f6); color: var(--ink); }
html body .sh-root.sh-wide .sh-wrap { max-width: 1280px; }
html body .sh-root.sh-wide .sh-title { color: var(--ink); font-size: 22px; }

/* Inside a shell iframe the dark class is on <html>, not <body>. */
html.hl-dark .hl-pill { background: #26304a; color: #c9d3e4; }
html.hl-dark .hl-pill.s-amber { background: #37301b; color: #fbbf24; }
html.hl-dark .hl-pill.s-blue { background: #1b2a44; color: #9bbcff; }
html.hl-dark .hl-pill.s-green { background: #1b3129; color: #5ccf9b; }
html.hl-dark .hl-pill.s-red { background: #3a2521; color: #f0a095; }
html.hl-dark .hl-pill.s-grey { background: #26304a; color: #c9d3e4; }
html body .sk-lead-h { margin: 0; font-size: 15px; font-weight: 700; color: var(--ink); }

/* In list mode the Leads screen's own green status strip steps aside: the list has its own thin strip. */
html body #view-leads.sk-list-on #rlv-leads-live { display: none !important; }
html.hl-dark .hl-pill-f select, html.hl-dark .hl-pill-f input, html.hl-dark .hl-search input { background: transparent !important; border: 0 !important; }
html body table.hl-lt tbody td.c-state { white-space: normal; overflow: visible; max-width: none; padding: 8px; }
