.clients-page { max-width: none; }
.client-sheet-tools { display: flex; align-items: center; margin-bottom: 18px; }
.client-sheet-search { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 660px; }
.client-sheet-search .text-input { flex: 1; width: 100%; min-width: 0; }
.client-sheet-search .text-link { 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: 1204px; border-spacing: 0; table-layout: fixed; font-size: var(--text-dense); }
.client-sheet-table > thead > tr > th { padding: 15px 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: 240px; position: sticky; left: 0; z-index: 2; }
.client-sheet-table > thead > tr > th:nth-child(2) { width: 86px; }
.client-sheet-table > thead > tr > th:nth-child(3) { width: 125px; }
.client-sheet-table > thead > tr > th:nth-child(4) { width: 150px; }
.client-sheet-table > thead > tr > th:nth-child(5), .client-sheet-table > thead > tr > th:nth-child(6) { width: 140px; }
.client-column-sort { display: flex; align-items: center; gap: 10px; min-height: 38px; margin: -8px -12px; padding: 8px 12px; 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: 48px; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line-soft); vertical-align: middle; }
.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; overflow-wrap: anywhere; }
.client-name-input { min-width: 0; width: 100%; 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(--accent-wash); }
.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-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-date-hint { display: block; margin-top: 2px; font-size: var(--text-meta); }
.client-cell-muted { color: var(--muted); font-size: var(--text-meta); }
.client-waiting { display: inline-flex; align-items: center; gap: 6px; padding: 5px 8px; min-height: 32px; background: var(--red-wash); color: var(--red); border: 0; border-radius: var(--radius-control); font-size: var(--text-meta); text-decoration: none; }
.client-waiting::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.client-waiting:not([aria-disabled="true"]):hover { text-decoration: underline; text-underline-offset: 3px; box-shadow: inset 0 0 0 1px var(--red-line); }
.client-waiting:not([aria-disabled="true"]):active { box-shadow: inset 0 0 0 1px var(--red); }
.client-sheet-finishes { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.client-profile-section { margin-bottom: 32px; }
.client-profile-section h2 { font-size: 15px; font-weight: 500; }
.client-profile-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.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-details .client-details-editor { border-top: 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 { padding: 16px 0; border-top: 1px solid var(--line); }
.client-reference summary { min-height: 40px; margin: -8px -12px; padding: 8px 12px; cursor: pointer; font-size: var(--text-dense); }
.client-reference summary:hover { color: var(--accent-hover); }
.client-reference summary:active { color: var(--accent-active); }
.client-reference summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 3px; }
.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:last-child { border-bottom: 0; padding-bottom: 0; }
@media (max-width: 760px) {
  .client-sheet-tools { margin-bottom: 8px; }
  .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 { --client-actions-width: 104px; min-width: 1136px; }
}
@media (max-width: 540px) {
  .client-details-ledger { grid-template-columns: 1fr; }
  .order-panel .client-details-ledger .detail-ledger__item { padding-right: 0; }
}
