/* Generation 43 Sales/Clients column geometry from the live reference. The shared record-table kit owns
   surfaces, borders, row/header height, hover, selection, and card radius. */
.sales-index > .sales-attention { width: 100%; margin: var(--space-4) 0 0; border: 0; padding: 0; }
.sales-table-scroll { width: 100%; min-width: 0; overflow: auto; }
.sales-table { width: var(--column-resize-width, 100%); min-width: var(--column-resize-width, 894px); letter-spacing: -.1px; }
.sales-table-header, .sales-record-row {
  display: grid;
  grid-template-columns: var(--column-resize-tracks, 24px minmax(160px, 1.2fr) minmax(130px, 1fr) minmax(240px, 2.4fr) 88px 104px 148px);
  align-items: center;
  gap: 0;
  padding: 0;
}
.sales-table-header > span, .sales-record-row > span {
  min-width: 0;
  padding-inline: var(--cell-padding-x);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sales-table .sales-record-row { color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.sales-record-row > span { display: block; height: 100%; align-content: center; }
.sales-record-row .sales-client { color: var(--ink); font-size: var(--text-body); line-height: 1.5; }
.sales-value { text-align: right; font-variant-numeric: tabular-nums; }
.sales-record-row .sales-status--attention { display: flex; align-items: center; gap: var(--tab-count-gap); color: var(--amber); }
.sales-status--attention::before { content: ""; width: var(--status-dot-size); height: var(--status-dot-size); flex: none; border-radius: 0; background: currentColor; }
.sales-attention-row:not(:last-child) > .sales-record-row { border-bottom: 1px solid var(--row-line); }
.sales-index .topbar-tabs { margin-left: var(--space-2); }
.sales-index .sales-topbar-tools { gap: var(--space-3); }
.sales-attention-empty { padding: var(--section-padding) 0; }
.sales-first-inquiry { padding-top: 0; }
.sales-first-inquiry h2, .sales-no-matches h2 { margin: 0 0 var(--space-1); font-size: var(--title-panel); line-height: var(--space-6); font-weight: 600; }
.sales-first-inquiry__lede { max-width: 560px; margin: 0 0 var(--space-4); color: var(--muted); font-size: var(--text-body); line-height: var(--line-workspace); }
.sales-journey { margin: 0; padding: 0; list-style: none; }
.sales-journey li { position: relative; display: flex; gap: var(--space-4); padding-bottom: var(--space-4); }
.sales-journey li:last-child { padding-bottom: 0; }
.sales-journey li:not(:last-child)::before { content: ""; position: absolute; left: 9.5px; top: 22px; bottom: 0; width: 1px; background: var(--input-line); }
.sales-journey__number { display: grid; place-items: center; flex: none; width: 20px; height: 20px; padding-top: var(--studio-copy-gap); border: 1px solid var(--input-line); border-radius: 0; color: var(--muted); font-size: var(--text-tiny); line-height: var(--text-tiny); }
.sales-journey li:first-child .sales-journey__number { background: var(--accent); color: var(--surface); border-color: var(--accent); }
.sales-journey h3 { margin: 0; font-size: var(--text-body); line-height: var(--line-workspace); font-weight: 600; letter-spacing: inherit; }
.sales-journey p { margin: var(--compact-copy-gap) 0 0; font-size: var(--text-meta); line-height: var(--line-meta); color: var(--muted); }
.sales-empty-note { margin: 0; padding-block: var(--space-4); font-size: var(--text-tiny); color: var(--muted); }
.sales-reply-setup { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); margin-inline: calc(-1 * var(--page-gutter)); padding: var(--space-6) var(--page-gutter); border-top: 1px solid var(--line); }
.sales-reply-setup h3 { margin: 0; font-size: var(--text-body); line-height: var(--line-workspace); font-weight: 400; }
.sales-reply-setup p { margin: var(--compact-copy-gap) 0 0; color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.sales-reply-setup__actions { display: flex; flex: none; align-items: center; gap: var(--space-3); }
.sales-reply-setup[hidden] { display: none; }
.sales-no-matches { text-align: left; }
.sales-no-matches p { margin: var(--space-1) 0 var(--space-2); }

.clients-page .client-sheet-scroll { width: 100%; margin: 0; }
.clients-page .client-sheet-table { display: block; min-width: var(--column-resize-width, 920px); width: var(--column-resize-width, 100%); border: 0; table-layout: auto; }
.client-sheet-table > :is(thead, tbody) { display: block; }
.client-sheet-table > :is(thead, tbody) > tr {
  display: grid;
  grid-template-columns: var(--column-resize-tracks, minmax(160px, 1.4fr) 56px 96px 132px 104px 104px minmax(120px, 1.4fr) 16px);
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-4) 0 var(--space-8);
}
.clients-page .client-sheet-table > :is(thead, tbody) > tr > :is(th, td) {
  position: static;
  display: flex;
  align-items: center;
  width: auto;
  height: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}
.client-sheet-table .client-column-sort { padding: 0; width: 100%; justify-content: inherit; font-size: var(--text-meta); color: var(--muted); }
.client-sheet-table th[aria-sort] .client-column-sort { color: var(--muted); }
.clients-page .client-sheet-table th:first-child .client-column-sort { padding: 0; }
.clients-page .client-sheet-table :is(th, td):is(.client-sheet-number, .client-sheet-date) { justify-content: flex-end; text-align: right; }
.clients-page .client-sheet-table :is(th, td).client-sheet-internal { margin-inline: calc(-1 * var(--tab-count-gap)); padding-inline: var(--tab-count-gap); background: var(--private-tint); }
.client-sheet-internal .client-column-sort { gap: var(--tab-count-gap); }
.client-sheet-internal svg { width: 12px; height: 12px; }
.client-sheet-table .client-sheet-name { min-width: 0; min-height: 0; gap: var(--brand-icon-gap); }
.client-sheet-row .client-open { display: block; flex: 1; min-width: 0; padding: 0; color: var(--ink); opacity: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-sheet-name textarea.client-name-input { min-width: 0; flex: 1; padding: 0 var(--space-2); height: var(--control-height); min-height: var(--control-height); }
.client-sheet-name [hidden] { display: none; }
.client-sheet-row .client-waiting { padding: 0; color: var(--ink); font-size: var(--text-body); }
.client-sheet-table .client-cell-zero { color: var(--tertiary); }
.client-sheet-table .client-sheet-finishes { display: block; align-content: center; font-size: var(--text-meta); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-sheet-table .client-sheet-finishes.client-cell-zero { color: var(--tertiary); }
.client-sheet-chevron { justify-content: flex-end; color: var(--tertiary); }
.client-sheet-chevron .record-row-chevron { display: flex; width: 16px; height: 18px; opacity: 0; }
.client-sheet-chevron svg { flex: none; width: 18px; height: 18px; }
.client-sheet-row:is(:hover, :focus-within, .is-selected) .record-row-chevron { opacity: 1; }
.clients-page .client-sheet-search .search-control { width: var(--search-width); min-width: 0; }
.clients-page .client-sheet-search { flex: none; }
/* Sales also needs the compact header beside an expanded tablet sidebar. */
@media (max-width: 1200px) {
  .workspace-content > .sales-index > .page-header { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: var(--topbar-height) auto; height: auto; gap: 0 var(--space-3); }
  .workspace-content > .sales-index > .page-header .page-header__actions { display: contents; }
  .sales-index .page-header .topbar-tabs { min-width: 0; width: 100%; margin-left: 0; overflow-x: auto; }
  .sales-index .sales-topbar-tools { grid-column: 1 / -1; justify-content: flex-end; flex-wrap: wrap; width: 100%; min-height: var(--topbar-height); padding-block: var(--space-2); gap: var(--space-2) var(--space-3); }
  .sales-index .sales-topbar-tools .topbar-search { flex-basis: 100%; width: 100%; }
}
@media (max-width: 760px) {
  .workspace-content > .clients-page > .page-header { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-auto-rows: var(--topbar-height); height: auto; gap: 0 var(--space-3); }
  .workspace-content > .clients-page > .page-header .page-header__actions { display: contents; }
  .clients-page .page-header__actions > .button { justify-self: end; }
  .clients-page .client-sheet-search { grid-column: 1 / -1; width: 100%; }
  .clients-page .client-sheet-search .search-control { width: 100%; }
  .sales-table-header, .sales-record-row { grid-template-columns: var(--column-resize-tracks, 24px minmax(160px, 1.2fr) minmax(130px, 1fr) minmax(240px, 2.4fr) 88px 104px 148px); }
  .sales-record-row > span { display: block; height: 100%; align-content: center; }
  .sales-record-row > .sales-status--attention { display: flex; }
}

.client-profile .record-panel-header__avatar { background: var(--record-avatar-background); color: var(--accent); font: 600 13px/13px var(--sans); border-radius: var(--radius-panel); }
.client-order-history__row { min-height: var(--space-12); gap: var(--space-3); padding-block: var(--space-2); }
.client-order-history__row:first-child { padding-top: 0; }
.client-order-history__row:last-child { padding-bottom: 0; }
.client-profile .client-order-history__thumbnail { width: var(--space-8); height: var(--space-8); flex-basis: var(--space-8); object-fit: cover; border-radius: var(--radius-panel); }
.client-order-history__identity { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: var(--compact-copy-gap); }
.client-order-history__identity > span { font-size: var(--text-body); line-height: 1.5; }
.client-order-history__identity > small { font-size: var(--text-meta); line-height: var(--line-meta); color: var(--muted); }
.client-order-history__row .stage-marker { color: var(--muted); }
.client-profile .client-add-detail { margin-left: calc(-1 * var(--space-2)); }
.client-profile .order-private-caption { font: 600 var(--text-body)/var(--line-body) var(--sans); color: var(--ink); }
.client-profile .detail-ledger { --field-label-width: var(--drawer-label-width); }

/* Client and Lead details share the measured drawer label/value geometry. */
.client-sheet-row .client-open { font-size: var(--text-body); line-height: 1.5; }
.client-reference-caption { margin: var(--space-3) 0 0; color: var(--muted); font-size: var(--text-meta); line-height: var(--line-meta); }
.client-new-form { display: flex; flex: 1; flex-direction: column; }
.client-new-form > .workspace-section { padding-block: var(--section-padding); }
.sales-lead-page .sales-lead-heading { margin-bottom: 0; }
.sales-lead-page .record-panel-header__avatar { background: var(--record-avatar-background); color: var(--accent); font: 600 13px/13px var(--sans); }
.sales-lead-page .detail-ledger { --field-label-width: var(--drawer-label-width); }
.order-panel .sales-lead-page .sales-workspace { display: block; }
.sales-lead-page .sales-workspace > :is(.sales-inquiry, .sales-details, .sales-next-step, .sales-correspondence, .sales-private) { margin: 0 calc(-1 * var(--panel-gutter)); padding: var(--section-padding) var(--panel-gutter); border-top: 1px solid var(--line); }
.sales-lead-page .sales-workspace > :first-child { border-top: 0; }
.sales-lead-page .sales-inquiry p { margin: 0; }
.sales-lead-page .sales-private { background: var(--private-tint); }
.sales-lead-page .sales-private p { margin: 0; }
.sales-lead-page .order-private-caption { font: 600 var(--text-body)/var(--line-body) var(--sans); color: var(--ink); }
.sales-private-editor { margin: var(--section-padding) calc(-1 * var(--panel-gutter)) 0; padding: var(--section-padding) var(--panel-gutter); background: var(--private-tint); }
.sales-lead-page .sales-private .button { margin-left: calc(-1 * var(--space-2)); }
.sales-lead-page .sales-draft-picker { gap: 0; margin: calc(-1 * var(--space-1)) 0 0; }
.sales-lead-page .sales-draft-picker__form.field-rows { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: var(--space-2); margin: 0; }
.sales-lead-page .sales-draft-picker__form .form-field { width: 100%; min-height: var(--field-row-height); }
.sales-lead-page .sales-draft-picker__form .button { justify-self: end; }
.sales-lead-page .sales-email-empty { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: var(--space-4); min-height: var(--space-12); align-content: center; margin: 0; }
.sales-lead-page .sales-email-empty h3 { margin: 0; font-size: var(--text-body); line-height: var(--line-workspace); font-weight: 400; letter-spacing: inherit; }
.sales-lead-page .sales-email-empty .field-hint { margin-top: var(--compact-copy-gap); }
.sales-lead-page .sales-email-empty > :is(h3, .field-hint) { grid-column: 1; }
.sales-lead-page .sales-email-empty > .button { grid-column: 2; grid-row: 1 / 3; align-self: center; }
@media (max-width: 760px) {
  .clients-page .client-sheet-search .search-control { width: 100%; }
  .order-panel .sales-lead-page .sales-lead-heading { padding-bottom: var(--panel-gutter); margin-bottom: 0; }
}

/* Drawer measurements from the rendered reference, including its compact key/value inset. */
.order-panel .client-profile .workspace-section.client-profile-section { margin-inline: calc(-1 * var(--panel-gutter)); padding-inline: var(--panel-gutter); }
:is(.sales-lead-page, .client-profile) .section-heading h2,
:is(.sales-lead-page, .client-profile) .order-private-caption { letter-spacing: -.025em; }
:is(.sales-lead-page, .client-profile) .order-private-caption { gap: var(--tab-count-gap); }
:is(.sales-lead-page, .client-profile) .order-private-caption svg { width: 14px; height: 14px; }
:is(.sales-lead-page, .client-profile) .detail-ledger { margin-top: -4px; }
:is(.sales-lead-page, .client-profile) .detail-ledger dd { line-height: 1.5; }
:is(.sales-lead-page, .client-profile) .field-rows { margin-top: -4px; }
:is(.sales-lead-page, .client-profile) .field-rows .text-input { line-height: 1.5; }
:is(.sales-lead-page, .client-profile) .field-rows input.text-input,
:is(.sales-lead-page, .client-profile) .field-rows select.text-input { padding-block: 0; }
:is(.sales-lead-page, .client-profile) .panel-edit-footer { padding-block: 12px; }
.sales-lead-page .sales-private > .order-private-caption { margin: 0 0 var(--space-1); }
.client-profile-section--private > .order-private-caption { margin-bottom: var(--space-2); }
.client-profile-section--private > .order-private-caption:has(+ .client-add-detail) { margin-bottom: var(--space-1); }
.sales-next-step__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 48px; }
.sales-next-step__row b { font-weight: 400; }
.sales-next-step__row p { margin: var(--compact-copy-gap) 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.sales-next-step__row form { flex: none; margin: 0; }

/* Creation drawers use the same header, field inset and footer as the live reference. */
.clients-search-tools { display: contents; }
:is(.sales-new-page, .client-new-page) .record-panel-header { padding-right: calc(var(--control-height) + var(--space-3)); }
:is(.sales-new-page, .client-new-page) .field-rows { margin-top: calc(-1 * var(--space-1)); }
:is(.sales-new-page, .client-new-page) .field-rows .text-input { line-height: var(--line-workspace); }
:is(.sales-new-page, .client-new-page) .field-rows input.text-input { padding-block: 0; }
:is(.sales-new-page, .client-new-page) .panel-edit-footer { padding-block: var(--space-3); }
.sales-new-page .form-field--inquiry { align-items: start; padding-block: var(--space-1); }
.sales-new-page .form-field--inquiry .field-label { padding-top: var(--tab-count-gap); }
.sales-new-page .form-field--inquiry textarea { height: var(--settings-textarea-height); min-height: var(--settings-textarea-height); padding: var(--tab-count-gap) var(--space-2); line-height: var(--line-body); }
