.clients-page { max-width: none; }
.client-sheet-tools { display: flex; align-items: center; margin-bottom: 16px; }
.client-sheet-search { display: flex; align-items: center; gap: 12px; width: 100%; }
.client-search-control { position: relative; flex: 0 1 360px; min-width: 0; }
.client-search-control > svg { position: absolute; top: 50%; left: 12px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.client-sheet-search .text-input { width: 100%; min-width: 0; min-height: 38px; height: 38px; padding: 8px 12px 8px 36px; font-size: var(--text-dense); }
.client-sheet-search .text-link { display: inline-flex; align-items: center; min-height: 38px; font-size: var(--text-dense); white-space: nowrap; }
.client-sheet-scroll { width: 100%; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.client-sheet-table { --client-actions-width: 132px; width: 100%; min-width: 1116px; border-spacing: 0; table-layout: fixed; font-size: var(--text-dense); }
.client-sheet-table > thead > tr > th { height: 44px; padding: 6px 16px; background: var(--table-header); border-bottom: 1px solid var(--line); color: var(--muted); font-weight: 500; font-size: var(--text-meta); text-align: left; white-space: nowrap; }
.client-sheet-table > thead > tr > .client-sheet-actions-heading { width: var(--client-actions-width); position: sticky; right: 0; z-index: 3; }
.client-sheet-table > thead > tr > th:first-child { width: 224px; position: sticky; left: 0; z-index: 2; }
.client-sheet-table > thead > tr > th:nth-child(2) { width: 72px; }
.client-sheet-table > thead > tr > th:nth-child(3) { width: 120px; }
.client-sheet-table > thead > tr > th:nth-child(4) { width: 144px; }
.client-sheet-table > thead > tr > th:nth-child(5), .client-sheet-table > thead > tr > th:nth-child(6) { width: 132px; }
.client-column-sort { display: flex; align-items: center; gap: 8px; min-height: 36px; margin: -4px -8px; padding: 8px; color: inherit; text-decoration: none; }
.client-column-sort:not([aria-disabled="true"]):hover { color: var(--accent-hover); }
.client-column-sort:not([aria-disabled="true"]):active { color: var(--accent-active); }
.client-column-sort:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
th[aria-sort] .client-column-sort { color: var(--accent); }
.client-column-sort span { color: var(--accent); }
.client-sheet-row > td { padding: 6px 16px; height: 52px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--surface); }
.client-sheet-row:hover > td, .client-sheet-row:focus-within > td { background-color: var(--paper); }
.client-sheet-row:last-child > td { border-bottom: 0; }
.client-sheet-row > .client-sheet-actions { padding: 4px 8px; position: sticky; right: 0; z-index: 2; background: var(--surface); }
.client-sheet-row > .client-sheet-identity { padding: 0; position: sticky; left: 0; z-index: 1; background: var(--surface); }
.client-sheet-name { display: flex; align-items: center; width: 100%; min-height: 52px; }
.client-sheet-name > strong { min-width: 0; flex: 1; align-self: center; padding: 10px 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-name-input { min-width: 0; width: 100%; height: 44px; padding: 10px 16px; color: var(--ink); font: 500 var(--text-dense)/1.5 var(--sans); text-overflow: ellipsis; border: 0; border-radius: var(--radius-input); outline: none; background: transparent; }
.client-name-input:not(:disabled):not([aria-invalid="true"]):hover { background: var(--paper-deep); }
.client-name-input:not(:disabled):not([aria-invalid="true"]):active { background: var(--accent-wash-hover); }
.client-name-input:focus { background: var(--surface); box-shadow: inset 0 0 0 2px var(--focus-ring); text-overflow: clip; }
.client-name-input:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.client-name-input:disabled { color: var(--muted); cursor: not-allowed; }
.client-name-input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--red); background: var(--red-wash); }
.client-name-input[aria-invalid="true"]:focus-visible { outline-color: var(--red); }
.client-sheet-row .client-open { min-height: 36px; padding: 8px 6px; gap: 8px; border-color: transparent; background: transparent; box-shadow: none; color: var(--ink); font-size: var(--text-meta); font-weight: 500; }
.client-sheet-row .client-open:hover { color: var(--accent-hover); border-color: transparent; background: transparent; }
.client-sheet-row .client-open:active { color: var(--accent-active); border-color: transparent; background: transparent; }
.client-sheet-row .client-open .record-action__icon { display: block; width: 14px; height: 14px; color: var(--muted); }
.client-sheet-row .client-open:hover .record-action__icon { color: inherit; }
.client-waiting:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }
.client-sheet-number, .client-sheet-date { font-variant-numeric: tabular-nums; }
.client-sheet-date { white-space: nowrap; }
.client-sheet-date--overdue { color: var(--red); }
.client-cell-muted { color: var(--muted); font-size: var(--text-meta); }
.client-waiting { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; min-height: 28px; background: var(--accent-wash); color: var(--accent); border: 1px solid var(--accent-line); border-radius: var(--radius-control); font-size: var(--text-meta); text-decoration: none; }
.client-waiting::before { content: ""; width: 5px; height: 5px; border-radius: var(--radius-control); background: currentColor; }
.client-waiting:not([aria-disabled="true"]):hover { background: var(--accent-wash-hover); text-decoration: underline; text-underline-offset: 3px; }
.client-waiting:not([aria-disabled="true"]):active { border-color: var(--accent); }
.client-sheet-finishes { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-profile .order-workspace { display: block; border-top: 1px solid var(--line); }
.client-profile-section:last-child { margin-bottom: 0; }
.client-profile-section h2 { margin: 0 0 16px; font-family: var(--sans); font-size: var(--title-section); font-weight: 600; }
.client-profile-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.client-profile-section-heading h2 { margin-bottom: 0; }
.client-profile-section-heading a { font-size: var(--text-meta); white-space: nowrap; }
.client-details > h2 { margin-bottom: 8px; }
.client-details-empty { color: var(--muted); font-size: var(--text-dense); }
.client-details-ledger dd { margin: 0; }
.client-details-ledger dd p { margin: 0 0 8px; }
.client-details-ledger dd p:last-child { margin-bottom: 0; }
.client-profile-form { margin-top: 20px; }
.client-profile-form > .button { margin-top: 20px; }
.client-profile-form [aria-invalid="true"] { border-color: var(--red); }
.client-profile-form textarea { resize: vertical; min-height: 88px; }
.client-waiting[aria-disabled="true"], .client-column-sort[aria-disabled="true"] { color: var(--muted); opacity: .55; cursor: not-allowed; }
.client-reference-list { list-style: none; padding: 0; margin: 10px 0 0; }
.client-reference-list li { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--text-dense); overflow-wrap: anywhere; }
.client-reference-list li:first-child { padding-top: 0; }
.client-reference-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.client-reference-list p { margin: 0; }
@media (max-width: 760px) {
  .client-sheet-tools { margin-bottom: 12px; }
  .client-search-control { flex-basis: 100%; }
  .client-sheet-search .text-input, .client-name-input { font-size: var(--text-body); }
  .client-sheet-table > thead > tr > th:first-child { width: 200px; position: static; }
  .client-sheet-row > .client-sheet-identity { position: static; }
  .client-sheet-table { min-width: 1092px; }
}
@media (max-width: 540px) {
  .client-profile-section-heading { align-items: flex-start; flex-direction: column; gap: 8px; }
  .client-details-ledger { grid-template-columns: 1fr; }
  .order-panel .client-details-ledger .detail-ledger__item { padding-right: 0; }
}
