/* V9b — lista de clientes igual ao mockup (docs/mockup-paridade-fresha/clientes-caixa.html, "Clientes · lista").
   Carregado depois do tailwind.css, então vence na cascata. Toda regra de botão fica presa a .cl-table / .cl-card. */

/* Cabeçalho da tabela: sem caixa alta, 13 px, peso 600, texto secundário (vence a regra global th). */
.cl-table th {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

/* Linha de ~55 px (faixa 54–58): o conteúdo do avatar de 40 px + 5 px acima e abaixo. */
.cl-table td { padding-top: 5px; padding-bottom: 5px; }

/* WhatsApp / Reconquistar na lista: ghost, sem borda. Reconquistar mantém a cor de aviso (.is-warn). */
.cl-table .cl-btn[data-client-wa],
.cl-card .cl-btn[data-client-wa] { border-color: transparent; background: transparent; }
.cl-table .cl-btn[data-client-wa]:hover,
.cl-card .cl-btn[data-client-wa]:hover { background: var(--state-hover); }

/* Celular: 4 contadores em grade 2x2, inteiros na tela. Vence o carrossel flex de 132 px do index.html (max-width 767). */
@media (max-width: 767px) {
  .cl-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow-x: visible; gap: 8px; }
}

/* Título da tela (dono/recepção): <h1> 28/36 peso 700 (24/32 no celular), subtítulo 15 px, 16 px até a busca (mockup .page-head). */
.cl > h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 700; }
.cl > [data-clientes-resumo] { margin: 0 0 16px; font-size: 15px; color: var(--text-muted); }
@media (max-width: 767px) {
  .cl > h1 { font-size: 24px; line-height: 32px; }
}

/* V9c — estados carregando / erro / vazio (mockup clientes-caixa.html, "estado vazio com 1 botão e skeleton").
   Caixa igual à do .cl-table-wrap; linha do skeleton de 56 px (.skrow); botão primário de 48 px (btn-lg). */
#tbl > [data-skeleton], #tbl > .cl-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; }
.cl .cl-sk-row, .cl-sheet .cl-sk-row { height: 56px; padding: 0 16px; box-sizing: border-box; }
.cl .cl-box .cl-btn.is-primary { min-height: 48px; padding: 0 24px; font-size: 16px; }
#stats > [data-stats-skeleton] { height: 106px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
#stats > [data-stats-error] { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; color: var(--text-muted); }
/* Contadores reais com a mesma altura do esqueleto (dono e barbeiro têm textos de larguras diferentes). */
/* Subtítulo (V9b) reserva a linha desde o início: senão a lista pula ~22 px quando os contadores chegam. */
.cl > [data-clientes-resumo] { min-height: 1.5em; }
.cl .cl-stats > .cl-stat, #stats > [data-stats-skeleton] { box-sizing: border-box; }
.cl .cl-stats > .cl-stat { display: flex; flex-direction: column; justify-content: flex-start; }
@media (max-width: 767px) {
  #stats > [data-stats-skeleton] { height: 100px; }
}

/* V9d — ficha do cliente com cara de mockup (tokens do frame Caixa: abas pílula, btn-md, KPIs; estado vazio com btn-lg). */
.cl-sheet .cl-head-name { font-size: 24px; line-height: 30px; font-weight: 700; }
.cl-sheet .cl-head .cl-sub { font-size: 15px; }
.cl-sheet .cl-tags .cl-tag { font-size: 13px; height: 24px; }
.cl-sheet [data-client-actions] { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-sheet [data-client-actions] .cl-btn { min-height: 36px; padding: 0 14px; font-size: 15px; font-weight: 500; }
.cl-sheet [data-client-actions] .cl-btn.is-primary { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; }
.cl-sheet .cl-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cl-sheet .cl-kpi { background: var(--surface); padding: 12px 14px; }
.cl-sheet .cl-kpi-n { font-size: 20px; line-height: 28px; font-weight: 700; }
.cl-sheet .cl-kpi-l { font-size: 13px; }
.cl-sheet .cl-sec { font-size: 15px; font-weight: 600; }
.cl-sheet .cl-next { font-size: 15px; min-height: 56px; box-sizing: border-box; }
.cl-sheet .cl-tabs { gap: 8px; border-bottom: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
.cl-sheet .cl-tab { flex: none; white-space: nowrap; min-height: 36px; padding: 0 16px; font-size: 15px; border: 1px solid var(--border-input); border-radius: 18px; }
.cl-sheet .cl-tab[aria-selected="true"] { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; }
.cl-sheet [data-tab-panel="agendamentos"] .cl-item, .cl-sheet [data-tab-panel="comandas"] .cl-item { font-size: 15px; min-height: 54px; box-sizing: border-box; }
#tbl [data-empty-filtered] h3 { font-size: 20px; line-height: 28px; font-weight: 600; }
@media (max-width: 767px) {
  .cl-sheet [data-client-actions] { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-sheet [data-client-actions] .cl-btn { min-height: 44px; }
  .cl-sheet .cl-head-name { font-size: 20px; line-height: 26px; }
  .cl-sheet .cl-tab { min-height: 44px; }
  /* r1: as 3 abas inteiras em 358 px (barbeiro: "Seus horários"/"Suas comandas"); preenchem a faixa em vez de rolar. */
  .cl-sheet .cl-tabs { gap: 6px; }
  .cl-sheet .cl-tab { flex: 1 1 auto; padding: 0 10px; }
}

/* V9e — chips 36/44 px, menu do chip, busca curta em caixa, rodapé de páginas e modal Bloquear (tokens do mockup .chip/.btn-md/.btn-lg). */
.cl .cl-chip { min-height: 36px; font-size: 15px; font-weight: 500; border-color: var(--border-input); }
.cl .cl-chip b { font-weight: 500; }
.cl .cl-chip.is-on { border-color: var(--text); }
.cl .cl-chip .cl-chip-short { display: none; white-space: nowrap; }
[data-filter-menu] { width: max-content; max-width: calc(100vw - 16px); }
[data-filter-menu] [role="menu"] { margin-top: 4px; min-width: 220px; max-height: 340px; overflow: auto; background: var(--container-primary); border: 1px solid var(--hairline); border-radius: 12px; padding: 4px; box-shadow: var(--elev-3); }
[data-filter-menu] [role="menuitemradio"] { width: 100%; height: 44px; box-sizing: border-box; display: flex; align-items: center; gap: 10px; padding: 0 12px; border: 0; border-radius: 8px; cursor: pointer; background: transparent; color: var(--text-muted); font-family: var(--ui); font-size: 15px; font-weight: 400; text-align: left; }
[data-filter-menu] [role="menuitemradio"]:hover { background: var(--state-hover); }
[data-filter-menu] [role="menuitemradio"][aria-checked="true"] { color: var(--text); font-weight: 600; }
[data-filter-menu] .fm-label { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-filter-menu] .fm-count { font-size: 15px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
[data-filter-menu] svg { flex: 0 0 auto; }
#tbl [data-search-short] { font-size: 15px; line-height: 22px; }
#tbl [data-search-short] h3 { font-size: 20px; line-height: 28px; font-weight: 600; }
#pg, #pg span { font-size: 15px; }
#pg #pp, #pg #pn { min-height: 36px; padding: 0 14px; font-size: 15px; font-weight: 500; background: transparent; border-color: var(--border-input); }
#pg [data-search-refine] { color: var(--text-muted); }
[data-block-dialog] h2 { margin: 0 0 8px; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--text); }
[data-block-dialog] .bd-text { margin-bottom: 12px; font-size: 15px; line-height: 22px; color: var(--text-muted); }
[data-block-dialog] .bd-label { display: block; margin-bottom: 4px; font-size: 15px; color: var(--text-muted); }
[data-block-dialog] #block-reason { box-sizing: border-box; height: 44px; font-size: 16px; }
[data-block-dialog] .bd-actions { display: flex; gap: 8px; margin-top: 16px; }
[data-block-dialog] .bd-actions button { flex: 1 1 0; min-width: 0; box-sizing: border-box; height: 48px; padding: 0 8px; white-space: nowrap; font-size: 16px; font-weight: 600; border-radius: var(--r-pill); }
[data-block-dialog] #block-cancel { background: transparent; border: 1px solid var(--border-input); color: var(--text); }
[data-block-dialog] #block-ok { background: var(--error); color: var(--btn-fg); border: 1px solid transparent; }
#cl-export { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; min-width: 44px; }
#cl-export svg { width: 18px; height: 18px; flex: none; }
#cl-export[aria-busy="true"] { opacity: .6; cursor: progress; }
#cl-export-msg:empty { display: none; }
/* Barra numa linha: busca, Exportar e Novo ficam juntos; os chips quebram para a linha de baixo. */
@media (min-width: 768px) {
  .cl .cl-bar .cl-search { order: 1; }
  .cl .cl-bar .cl-grow { order: 2; }
  .cl .cl-bar #cl-export { order: 3; }
  .cl .cl-bar #newcli { order: 4; }
  /* quebra fixa: busca e ações na 1ª linha, todos os chips juntos na 2ª (não sobra chip sozinho entre os botões) */
  .cl .cl-bar::after { content: ''; order: 5; flex-basis: 100%; height: 0; }
  .cl .cl-bar .cl-chip { order: 6; }
}
@media (max-width: 767px) {
  .cl .cl-bar .cl-search { flex: 1 1 0; }
  .cl .cl-bar #cl-export { order: 1; justify-content: center; padding: 0; }
  #cl-export .cl-export-txt { display: none; }
  .cl .cl-chip { min-height: 44px; flex: 1 1 40%; min-width: 0; padding: 0 10px; gap: 4px; justify-content: space-between; }
  .cl .cl-chip .cl-chip-full { display: none; }
  .cl .cl-chip .cl-chip-short { display: inline; }
  .cl .cl-bar #newcli { order: 1; }
  .cl .cl-bar .cl-grow { display: block; flex: 0 0 100%; height: 0; order: 2; }
  #pg #pp, #pg #pn { min-height: 44px; }
}

/* V9f — formulário Novo/Editar cliente: mesma cara do modal Bloquear (h2 20, rótulo 15, campo 44/16, botões 48 lado a lado). */
[data-client-form] h2 { margin: 0 0 16px; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--text); }
[data-client-form] .cf-label { display: block; margin-bottom: 4px; font-size: 15px; color: var(--text-muted); text-transform: none; letter-spacing: normal; }
[data-client-form] .cf-input { display: block; width: 100%; box-sizing: border-box; height: 44px; margin-bottom: 12px; padding: 0 12px; font-size: 16px; }
[data-client-form] .cf-input:disabled { color: var(--text-muted); }
[data-client-form] .cf-locked { margin: -4px 0 12px; font-size: 15px; line-height: 22px; color: var(--text-muted); }
[data-client-form] .cf-actions { display: flex; gap: 8px; margin-top: 16px; }
[data-client-form] .cf-actions button { flex: 1 1 0; min-width: 0; box-sizing: border-box; height: 48px; padding: 0 8px; white-space: nowrap; font-size: 16px; font-weight: 600; border-radius: var(--r-pill); }
[data-client-form] #close { background: transparent; border: 1px solid var(--border-input); color: var(--text); }
[data-client-form] #ok { background: var(--btn-bg); color: var(--btn-fg); border: 1px solid transparent; }
[data-client-form] .cf-error { margin-top: 12px; min-height: 22px; font-size: 15px; line-height: 22px; text-align: center; color: var(--error); }

/* V9g — Conta do cliente (+Crédito/−Débito/Anular) e aba Pacotes: mesma cara do Bloquear/Novo cliente (h2 20, rótulo 15, campo 44/16, botões 48). */
[data-ledger-form] h2, [data-void-dialog] h2 { margin: 0 0 16px; font-size: 20px; line-height: 28px; font-weight: 600; color: var(--text); }
[data-ledger-form] .lf-label, [data-void-dialog] .vd-label { display: block; margin-bottom: 4px; font-size: 15px; color: var(--text-muted); text-transform: none; letter-spacing: normal; }
[data-ledger-form] .lf-input, [data-void-dialog] .vd-input { display: block; width: 100%; box-sizing: border-box; height: 44px; margin-bottom: 12px; padding: 0 12px; font-size: 16px; }
[data-void-dialog] .vd-text { margin-bottom: 12px; font-size: 15px; line-height: 22px; color: var(--text-muted); }
[data-ledger-form] .lf-actions, [data-void-dialog] .vd-actions { display: flex; gap: 8px; margin-top: 16px; }
[data-ledger-form] .lf-actions button, [data-void-dialog] .vd-actions button { flex: 1 1 0; min-width: 0; box-sizing: border-box; height: 48px; padding: 0 8px; white-space: nowrap; font-size: 16px; font-weight: 600; border-radius: var(--r-pill); }
[data-ledger-form] #close, [data-void-dialog] #void-cancel { background: transparent; border: 1px solid var(--border-input); color: var(--text); }
[data-ledger-form] #ok { background: var(--btn-bg); color: var(--btn-fg); border: 1px solid transparent; }
[data-void-dialog] #void-ok { background: var(--error); color: var(--btn-fg); border: 1px solid transparent; }
[data-ledger-form] .lf-error, [data-void-dialog] .vd-error { margin-top: 12px; min-height: 22px; font-size: 15px; line-height: 22px; text-align: center; color: var(--error); }
.cl-sheet [data-client-account] [data-ledger-new] { min-height: 36px; padding: 0 14px; font-size: 15px; font-weight: 500; }
.cl-sheet [data-client-account] .cl-item { font-size: 15px; min-height: 54px; box-sizing: border-box; }
.cl-sheet [data-client-account] [data-ledger-entry] { display: flex; flex-wrap: wrap; align-items: center; }
.cl-sheet [data-client-account] [data-ledger-entry] > span:first-child { flex: 1 1 0; min-width: 0; }
.cl-sheet [data-client-account] [data-ledger-entry] .cl-num { margin-left: auto; white-space: nowrap; }
.cl-sheet [data-client-account] .cl-entry-note { flex-basis: 100%; }
.cl-sheet [data-client-account] [data-ledger-void] { min-height: 36px; padding: 0 12px; font-size: 15px; font-weight: 500; background: transparent; white-space: nowrap; }
.cl-sheet [data-tab-panel="pacotes"] [data-pk-card] > .pk-row > b { font-size: 16px; font-weight: 600; }
.cl-sheet [data-tab-panel="pacotes"] .pk-pkg .pk-big { font-size: 24px; }
.cl-sheet [data-tab-panel="pacotes"] .pk-pkg .pk-big small, .cl-sheet [data-tab-panel="pacotes"] .pk-sub { font-size: 15px; }
.cl-sheet [data-tab-panel="pacotes"] .pk-chip { padding: 3px 10px; font-size: 13px; font-weight: 600; letter-spacing: normal; text-transform: none; }
.cl-sheet [data-tab-panel="pacotes"] .pk-chip i { display: none; }
.cl-sheet [data-tab-panel="pacotes"] .pk-bar { display: block; width: 100%; height: 8px; }
.cl-sheet [data-tab-panel="pacotes"] .pk-note { margin-top: 10px; font-size: 15px; }
.cl-sheet [data-tab-panel="pacotes"] .pk-btn.is-small { min-height: 36px; padding: 0 14px; font-size: 15px; font-weight: 600; white-space: nowrap; }
.cl-sheet [data-tab-panel="pacotes"] .pk-h3 { margin: 18px 0 10px; font-size: 15px; font-weight: 600; letter-spacing: normal; text-transform: none; color: var(--text); }
.cl-sheet [data-tab-panel="pacotes"] .pk-tl > div { font-size: 15px; }
.cl-sheet [data-tab-panel="pacotes"] .pk-tl small { font-size: 13px; }
.cl-sheet [data-tab-panel="pacotes"] .pk-sub.pk-foot { margin-top: 12px; font-size: 13px; }
@media (max-width: 767px) {
  .cl-sheet [data-client-account] [data-ledger-new], .cl-sheet [data-client-account] [data-ledger-void] { min-height: 44px; }
  .cl-sheet [data-tab-panel="pacotes"] .pk-btn.is-small { min-height: 44px; }
}
[data-lgpd-dialog] .bd-actions { display: flex; gap: 8px; margin-top: 16px; }
[data-lgpd-dialog] .bd-actions button { flex: 1 1 0; min-width: 0; box-sizing: border-box; height: 48px; padding: 0 8px; white-space: nowrap; font-size: 16px; font-weight: 600; border-radius: var(--r-pill); }
[data-lgpd-dialog] #lgpd-cancel { background: transparent; border: 1px solid var(--border-input); color: var(--text); }
[data-lgpd-dialog] #lgpd-ok { background: var(--error); color: var(--btn-fg); border: 1px solid transparent; }

/* CLI1-F4 — abas Lista/Segmentos e cartões de segmento (cor só por var(--…)). */
.cl-seg-tabs { display: flex; gap: 8px; margin: 0 0 12px; }
.cl-seg-tabs [role="tab"] { min-height: 44px; min-width: 44px; padding: 0 18px; font-size: 15px; font-weight: 500; cursor: pointer; background: transparent; color: var(--text); border: 1px solid var(--border-input); border-radius: 22px; }
.cl-seg-tabs [role="tab"][aria-selected="true"] { background: var(--btn-bg); color: var(--btn-fg); border-color: transparent; }
.cl-seg-tabs [role="tab"]:focus-visible, .cl-seg-card:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#cl-seg[hidden] { display: none; }
.cl-seg-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 768px) { .cl-seg-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cl-seg-card { display: flex; align-items: flex-start; gap: 16px; width: 100%; min-height: 72px; box-sizing: border-box; padding: 16px; text-align: left; cursor: pointer; font-family: var(--ui); color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); }
.cl-seg-card:hover { background: var(--state-hover); }
.cl-seg-ico { flex: none; display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--surface-2); color: var(--text); }
.cl-seg-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.cl-seg-name { font-size: 16px; line-height: 22px; font-weight: 700; }
.cl-seg-count { font-size: 15px; line-height: 22px; font-weight: 500; }
.cl-seg-rule { font-size: 14px; line-height: 20px; color: var(--text-muted); }
.cl-seg-sk { height: 88px; border-radius: var(--r-md); background: var(--surface); }
