.clients-page { min-height: 100%; display: flex; flex-direction: column; color: #131722; }
.clients-heading { display: flex; align-items: center; gap: 16px; padding: 24px 28px 18px; }
.clients-heading h1 { margin: 0; font-size: 25px; line-height: 32px; font-weight: 700; }
.clients-preview { color: #6b7280; font-size: 12px; border: 1px solid #e6e8eb; border-radius: 4px; padding: 4px 8px; }
.clients-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 28px 18px; }
.clients-filters { display: flex; gap: 6px; }
.clients-filters button { padding: 9px 17px; border-radius: 6px; font-size: 15px; }
.clients-filters button:hover { background: #f6f6f7; }
.clients-filters button[aria-pressed='true'] { background: #eff0f2; font-weight: 700; }
.clients-search { display: flex; align-items: center; gap: 10px; width: 355px; max-width: 100%; border: 1px solid #e2e4e8; border-radius: 6px; padding: 9px 12px; }
.clients-search:focus-within { outline: 2px solid #3578c8; outline-offset: 1px; }
.clients-search svg { width: 20px; height: 20px; color: #697180; }
.clients-search input { font: inherit; font-size: 14px; width: 100%; min-width: 0; border: 0; outline: none; background: transparent; color: inherit; }
.clients-search input::placeholder { color: #6b7280; }
.clients-table-scroll { overflow: auto; min-height: 0; }
.clients-table { border-collapse: collapse; width: 100%; min-width: 650px; text-align: left; table-layout: fixed; }
.clients-table caption { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.clients-table th { height: 49px; color: #626b7a; font-size: 13px; font-weight: 400; border-top: 1px solid #eceef0; border-bottom: 1px solid #e4e7eb; background: #fff; }
.clients-table th, .clients-table td { padding: 0 28px; }
.clients-table th:first-child { width: 18%; }
.clients-table th:nth-child(2), .clients-table th:nth-child(3) { width: 23%; }
.clients-table th:nth-child(4) { width: 21%; }
.clients-table th:last-child { width: 15%; }
.clients-table td { height: 51px; font-size: 16px; border-bottom: 1px solid #eff0f2; }
.clients-table tbody tr:hover { background: #f4f4f5; }
.clients-contract { display: inline-block; min-width: 65px; text-align: center; padding: 5px 10px; background: #f1f2f4; border-radius: 6px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.clients-amount { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.clients-amount small { font-size: 11px; color: #626b7a; font-weight: 400; }
.clients-status { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.clients-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.clients-status.is-active { color: #008476; }
.clients-status.is-cut { color: #cf3049; }
.clients-table .clients-empty { height: 160px; text-align: center; font-size: 14px; color: #626b7a; }
.clients-footer { padding: 16px 28px; color: #6b7280; font-size: 12px; }
@media (max-width: 950px) {
  .clients-table th, .clients-table td { padding: 0 16px; }
  .clients-heading { padding: 20px 18px 16px; }
  .clients-toolbar { padding: 0 18px 16px; gap: 12px; }
}
@media (max-width: 680px) {
  .clients-toolbar { align-items: stretch; flex-direction: column; }
  .clients-heading { flex-wrap: wrap; gap: 10px; }
  .clients-search { width: 100%; }
}

.clients-selectable { cursor: pointer; }
.profile-invoice-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 26px; }
.profile-invoice-toolbar h2 { margin: 0; }
.historical-primary { background: #171717; color: white; padding: 12px 18px; border-radius: 6px; font-size: 14px; font-weight: 700; }
.historical-primary:hover { background: #343434; }
.historical-dialog { width: min(740px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); padding: 0; border: 1px solid #e5e7eb; border-radius: 10px; color: #151515; background: white; overflow: auto; }
.historical-dialog::backdrop { background: rgb(25 30 36 / 30%); }
.historical-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 26px 28px 0; }
.historical-header h1 { font-size: 26px; line-height: 1.2; margin: 0; }
.historical-client { font-size: 14px; color: #6b7280; margin: 10px 0 0; }
.historical-close { padding: 6px; border-radius: 4px; }
.historical-close svg { width: 22px; height: 22px; }
.historical-body { padding: 0 28px; }
.historical-note { color: #747982; font-size: 12px; line-height: 1.5; margin: 12px 0 18px; }
.historical-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.historical-three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.historical-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: #626975; font-size: 13px; }
.historical-field input, .historical-field select, .historical-field textarea { width: 100%; min-width: 0; border: 1px solid #d8dce1; border-radius: 5px; padding: 10px 11px; font: inherit; font-size: 15px; color: #171717; background: white; }
.historical-field textarea { resize: vertical; }
.historical-dialog :is(input, select, textarea, summary):focus-visible { outline: 2px solid #3578c8; outline-offset: 2px; }
.historical-reference { margin-top: 16px; }
.historical-dialog fieldset { min-width: 0; padding: 18px 0 0; margin: 24px 0 0; border: 0; border-top: 1px solid #e6e8eb; }
.historical-dialog legend { padding: 0 12px 0 0; font-size: 17px; font-weight: 700; }
.historical-modes { display: flex; gap: 4px; margin-bottom: 16px; }
.historical-modes label { position: relative; cursor: pointer; }
.historical-modes input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.historical-modes span { display: block; border: 1px solid #d8dce1; border-radius: 5px; padding: 11px 20px; font-size: 14px; }
.historical-modes input:checked + span { color: white; background: #171717; border-color: #171717; }
.historical-modes input:focus-visible + span { outline: 2px solid #3578c8; outline-offset: 2px; }
.historical-automatic { padding: 16px; background: #f6f7f8; border-radius: 6px; }
.historical-automatic .historical-note { margin-bottom: 0; }
.historical-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 14px; }
.historical-check input { accent-color: #171717; width: 16px; height: 16px; }
.historical-extra { margin: 20px 0; }
.historical-extra summary { cursor: pointer; color: #626975; font-size: 14px; }
.historical-extra .historical-grid { margin-top: 16px; }
.historical-total { border-top: 1px solid #e6e8eb; margin-top: 20px; padding-top: 18px; display: flex; align-items: center; justify-content: space-between; }
.historical-total span { font-size: 14px; }
.historical-total strong { font-size: 28px; }
.historical-total small { font-size: 13px; font-weight: 400; }
.historical-feedback { font-size: 13px; color: #545b65; line-height: 1.5; }
.historical-footer { padding: 20px 28px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.historical-cancel { padding: 11px 18px; border: 1px solid #d8dce1; border-radius: 5px; font-size: 14px; }
@media (max-width: 600px) {
  .profile-invoice-toolbar { align-items: flex-start; flex-direction: column; }
  .historical-header { padding: 20px 18px 0; }
  .historical-header h1 { font-size: 23px; }
  .historical-body { padding: 0 18px; }
  .historical-footer { padding: 20px 18px; }
  .historical-grid { grid-template-columns: 1fr; }
  .historical-modes span { padding: 10px 13px; }
}
.client-profile { padding: 30px 40px 48px; color: #111; }
.profile-breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; color: #777; font-size: 14px; }
.profile-breadcrumb button:hover { text-decoration: underline; }
.profile-breadcrumb > span:last-child { color: #a0a0a0; }
.profile-header { display: flex; align-items: center; gap: 40px; margin: 52px 0 46px; }
.profile-avatar { display: grid; place-items: center; flex: 0 0 168px; height: 168px; border-radius: 50%; background: #edf5ff; color: #2189de; font-size: 58px; font-weight: 700; }
.profile-summary { min-width: 0; }
.profile-summary h1 { margin: 0 0 14px; font-size: clamp(32px, 3.8vw, 52px); line-height: 1.15; overflow-wrap: anywhere; }
.profile-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; width: fit-content; border: 1px solid #e7e7e7; border-radius: 8px; padding: 9px 12px; font-size: 16px; }
.profile-balance { display: flex; align-items: baseline; gap: 8px; margin: 20px 0 4px; font-variant-numeric: tabular-nums; }
.profile-balance strong { font-size: 52px; line-height: 1.15; }
.profile-balance small { font-size: 14px; }
.profile-caption { margin: 0; color: #777; font-size: 16px; }
.profile-caption span { color: #929292; font-size: 13px; }
.profile-tabs { display: flex; gap: 28px; border-bottom: 4px solid #f1f1f1; overflow-x: auto; }
.profile-tabs button { position: relative; flex-shrink: 0; padding: 10px 0 13px; font-size: 17px; font-weight: 700; }
.profile-tabs button[aria-selected='true'] { box-shadow: inset 0 -4px #303030; }
.profile-panel { padding: 32px 0; }
.profile-panel h2 { margin: 0 0 26px; font-size: 22px; }
.profile-details { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; margin: 0; }
.profile-details dt { color: #777; font-size: 14px; margin-bottom: 10px; }
.profile-details dd { margin: 0; font-size: 18px; overflow-wrap: anywhere; }
.profile-empty { max-width: 600px; color: #777; font-size: 15px; line-height: 1.7; }
@media (max-width: 900px) { .client-profile { padding: 26px; } .profile-header { gap: 24px; } .profile-avatar { flex-basis: 120px; height: 120px; font-size: 42px; } .profile-details { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .client-profile { padding: 22px 16px; } .profile-header { align-items: flex-start; flex-direction: column; margin: 32px 0; } .profile-avatar { flex-basis: auto; width: 96px; height: 96px; font-size: 34px; } .profile-tabs { gap: 22px; } .profile-meta { font-size: 14px; } .profile-balance strong { font-size: 42px; } }
.profile-missing { color: #888; font-size: 15px !important; }
.profile-table-scroll { overflow-x: auto; width: 100%; }
.profile-table-scroll table { width: 100%; min-width: 650px; border-collapse: collapse; text-align: left; }
.profile-table-scroll caption { text-align: left; color: #777; font-size: 13px; padding-bottom: 16px; }
.profile-table-scroll th { padding: 16px; font-size: 14px; font-weight: 500; border-block: 1px solid #ececec; white-space: nowrap; }
.profile-table-scroll td { padding: 36px 16px; color: #888; font-size: 14px; border-bottom: 1px solid #ececec; }

/* Resumo financeiro: mais área útil para saldos e faturas. */
.profile-header { gap: 28px; margin: 30px 0; }
.profile-avatar { flex-basis: 120px; height: 120px; font-size: 44px; }
.profile-summary h1 { font-size: clamp(30px, 3vw, 42px); }
.profile-balance { margin-top: 14px; }
.profile-balance strong { font-size: 40px; }
.profile-balances { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.profile-balances article { border: 1px solid #e6e8eb; border-radius: 12px; padding: 18px 20px; }
.profile-balances h3 { font-size: 16px; font-weight: 400; margin: 0; }
.profile-balances p { margin: 12px 0 6px; font-size: 28px; font-weight: 700; }
.profile-balances span, .profile-financial-note { color: #777; font-size: 13px; line-height: 1.6; }
.profile-financial-note { margin: 16px 0 30px; }
.profile-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.profile-view-invoices { font-size: 14px; color: #2167bc; padding: 8px 0; }
.profile-view-invoices:hover { text-decoration: underline; }
@media (max-width: 900px) { .profile-balances { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .profile-avatar { flex-basis: auto; width: 96px; height: 96px; font-size: 34px; } .profile-balances { grid-template-columns: 1fr; } .profile-section-heading { align-items: flex-start; flex-direction: column; margin-bottom: 16px; gap: 0; } }
