/* Hallmark · genre: modern-minimal · macrostructure: Workbench · design-system: design.md · designed-as-app */
/* Central · clientes (Agenda, Pendências, Todos os clientes). Só tokens; sem estilos embutidos. */
.clients-workspace { min-width: 0; }
.clients-intro { margin: 0 0 26px; max-width: 66ch; font-size: clamp(17px, 1.7vw, 21px); color: var(--muted); line-height: 1.55; }
.clients-tabs { border-bottom: 1px solid var(--line-strong); border-radius: 0; gap: 2px; margin: 0 0 20px; padding: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
.clients-tabs .pill { flex: none; background: transparent; border: 0; border-bottom: 3px solid transparent; border-radius: 0; color: var(--muted); padding: 0 16px; min-height: 48px; }
.clients-tabs .pill:hover { background: var(--surface-2); color: var(--ink); }
.clients-tabs .pill[aria-pressed="true"] { background: transparent; border-bottom-color: var(--brand); color: var(--brand-2); }
.clients-search { margin-bottom: 16px; }
.clients-search .field { max-width: 580px; }
.conversation-list { padding: 0; overflow: hidden; box-shadow: none; }
.conversation-heading { display: flex; gap: 12px; align-items: baseline; justify-content: space-between; padding: 16px 20px; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.conversation-heading h2 { font-size: var(--fs-md); }
.conversation-list .rows { gap: 0; }
.conversation-list .rows > .row { min-height: 82px; border-radius: 0; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.conversation-list .rows > .row:last-child { border-bottom: 0; }
.conversation-list .rows > .row .m b { font-size: var(--fs-base); margin-bottom: 3px; }
.conversation-list .rows > .row .m span { font-size: var(--fs-sm); }
.conversation-list .rows > .row .r b { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); margin-top: 5px; }
.conversation-list .rows > .empty, .conversation-list .rows > p { padding: 24px; }
.cl-root { display: grid; gap: 12px; min-width: 0; }
.cl-root > * { min-width: 0; }

/* cabeçalho e filtros */
.cl-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cl-scope { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.cl-sel { display: grid; gap: 3px; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); min-width: 0; }
.cl-sel .inp { height: 40px; width: auto; min-width: 160px; max-width: 100%; }
.cl-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.cl-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.cl-toolbar { margin-bottom: 0; }
.cl-toolbar .field { flex: 1 1 260px; }
.cl-chip .cl-n { display: inline-block; min-width: 20px; margin-left: 4px; padding: 0 6px; border-radius: var(--r-pill); background: var(--surface-2); color: var(--muted); font-size: var(--fs-xs); font-weight: 800; line-height: 20px; text-align: center; }
.cl-chip[aria-pressed="true"] .cl-n { background: var(--bg); color: var(--ink); }
.cl-filters { gap: 8px; }
.cl-warn { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cl-count { margin: 0; }
.cl-views { display: grid; gap: 6px; justify-items: start; }
.cl-views-in { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; padding: 6px 0 10px; }

/* indicadores */
.cl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cl-stats .stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; box-shadow: none; }
.cl-stats .stat b { font-family: var(--font-display, var(--font)); }
.cl-stats .stat.is-bad b { color: var(--coral-ink); }
@media (max-width: 560px) { .cl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* cartões de compromisso, promessa e ocorrência */
.cl-sec { display: grid; gap: 10px; }
.cl-sec + .cl-sec { margin-top: 6px; }
.cl-sec-h { font-size: var(--fs-sm); letter-spacing: .05em; text-transform: uppercase; color: var(--muted); display: flex; gap: 8px; align-items: center; margin: 0; }
.cl-cards { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 1100px) { .cl-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cl-card { padding: 18px var(--sp-5); display: grid; gap: 12px; align-content: start; box-shadow: none; }
.cl-card.is-attn { border-left: 4px solid var(--sun); }
.cl-card-top { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; }
.cl-who { display: flex; gap: 10px; align-items: center; min-width: 0; flex: 1 1 220px; }
.cl-id { display: grid; min-width: 0; }
.cl-id b { overflow-wrap: anywhere; }
.cl-id .sub { font-size: var(--fs-xs); overflow-wrap: anywhere; }
.cl-tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cl-tags .tag { white-space: normal; text-align: left; line-height: 1.25; }
.cl-facts { display: flex; gap: 6px 22px; flex-wrap: wrap; margin: 0; }
.cl-fact { display: grid; gap: 1px; min-width: 0; }
.cl-fact dt { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.cl-fact dd { margin: 0; font-size: var(--fs-base); overflow-wrap: anywhere; }
.cl-note { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; font-size: var(--fs-base); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.cl-scope-note { font-size: var(--fs-xs); }
.cl-titles { font-size: var(--fs-sm); }
.cl-titles summary { cursor: pointer; font-weight: 700; min-height: var(--hit-sm); display: flex; align-items: center; }
.cl-titles ul { margin: 4px 0 0; padding-left: 18px; color: var(--muted); display: grid; gap: 2px; }
.cl-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* tabela de clientes (vira cartões no celular) */
.cl-tblcard { padding: 0; overflow-x: auto; box-shadow: none; }
.cl-tbl td, .cl-tbl th { vertical-align: middle; }
.cl-tbl th { font-size: var(--fs-xs); background: var(--surface-2); padding-block: 14px; }
.cl-tbl td { padding-block: 17px; }
.cl-tbl tr.is-attn td:first-child { box-shadow: inset 4px 0 0 var(--sun); }
.cl-tbl .cl-c-sel { width: 44px; text-align: center; }
.cl-tbl .cl-c-sel input { width: 24px; height: 24px; }
.cl-tbl .cl-c-name { min-width: 240px; }
.cl-last { display: block; font-size: var(--fs-xs); margin-top: 2px; padding-left: 50px; }
.cl-amt { display: block; font-size: var(--fs-xs); }
.cl-tbl .cl-c-act { white-space: nowrap; }
.cl-tbl .cl-c-act .btn + .btn { margin-left: 6px; }
.cl-owner { font-weight: 700; font-size: var(--fs-sm); }
.cl-owner.is-me { color: var(--brand-2); }
.cl-bulk { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 14px; font-size: var(--fs-sm); color: var(--muted); background: var(--surface-2); }
.cl-bulk.on { background: var(--mint-soft); border-style: solid; border-color: transparent; color: var(--ink); }
@media (max-width: 820px) {
  .cl-tblcard { padding: 0; background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .cl-tbl, .cl-tbl tbody, .cl-tbl tr, .cl-tbl td { display: block; width: 100%; }
  .cl-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cl-tbl tr { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; margin-bottom: 10px; box-shadow: none; display: grid; gap: 8px; }
  .cl-tbl tr.is-attn { border-left: 4px solid var(--sun); }
  .cl-tbl tr.is-attn td:first-child { box-shadow: none; }
  .cl-tbl td { border: 0; padding: 0; text-align: left; }
  .cl-tbl td.r { text-align: left; }
  .cl-tbl td[data-l]:not([data-l=""])::before { content: attr(data-l); display: block; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
  .cl-tbl .cl-c-sel { width: auto; text-align: left; }
  .cl-tbl .cl-c-name { min-width: 0; }
  .cl-tbl .cl-c-act { white-space: normal; display: flex; gap: 8px; flex-wrap: wrap; }
  .cl-tbl .cl-c-act .btn + .btn { margin-left: 0; }
  .cl-tags { justify-content: flex-start; }
}

/* diálogos */
.cl-dlg { gap: 12px; }
.cl-dlg-body { display: grid; gap: 12px; }
.cl-dlg-actions { margin-top: 4px; }
.cl-dlg .inp.area { min-height: 96px; }
.cl-picker { height: auto; min-height: 150px; padding: 6px; }
.cl-totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
.cl-totals div { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 12px; }
.cl-totals dt { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); }
.cl-totals dd { margin: 0; font-weight: 800; font-size: var(--fs-md); }
@media (max-width: 560px) { .cl-totals { grid-template-columns: minmax(0, 1fr); } }
.cl-events { border: 1px solid var(--line); border-radius: var(--r-md); padding: 8px 12px 10px; display: grid; gap: 8px; margin: 0; min-width: 0; }
.cl-events legend { font-size: var(--fs-xs); font-weight: 700; color: var(--muted); padding: 0 6px; }
.cl-event { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.cl-event > span { display: grid; min-width: 0; }
.cl-event input { margin-top: 2px; }
.cl-reasons { margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--fs-sm); display: grid; gap: 2px; }

/* filtros da carteira numa só linha que quebra */
.cl-filterbar { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: flex-end; }
.cl-filterbar .cl-scope, .cl-filterbar .cl-controls { display: contents; }
.cl-tbl .cl-tags { justify-content: flex-start; }
.cl-tbl td.r { white-space: nowrap; }
.cl-tbl .cl-c-name { min-width: 300px; }
@media (max-width: 820px) { .cl-tbl .cl-c-name { min-width: 0; } .cl-tbl td.r { white-space: normal; } .cl-last { padding-left: 0; } }
@media (max-width: 560px) {
  .clients-tabs { margin-bottom: 14px; }
  .clients-tabs .pill { padding-inline: 12px; min-height: 46px; font-size: var(--fs-sm); }
  .clients-search { margin-bottom: 12px; }
  .clients-search .field { flex-basis: 100%; }
  .conversation-heading { padding: 14px; }
  .conversation-list .rows > .row { padding: 14px; gap: 10px; align-items: start; }
  .conversation-list .rows > .row .m { flex-basis: calc(100% - 54px); }
  .conversation-list .rows > .row .r { padding-left: 50px; margin-left: 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; text-align: left; }
  .conversation-list .rows > .row .r b { margin-top: 0; }
  .cl-filters { gap: 6px; }
  .cl-root .pill { padding: 0 11px; font-size: var(--fs-sm); }
  .cl-sel .inp { min-width: 0; }
  .cl-scope .cl-sel, .cl-filterbar .cl-sel { flex: 1 1 140px; }
}

/* Esmeralda Editorial · uma carteira contínua, com filtros e decisões legíveis. */
.clients-tabs { margin-bottom: 24px; border-color: var(--line); }
.clients-tabs .pill { min-height: 54px; padding-inline: 18px; font-size: 16px; }
.clients-tabs .pill:first-child { padding-left: 4px; }
.clients-search { margin-bottom: 24px; }
.clients-search .field { background: var(--surface); }
.conversation-heading { padding: 22px 24px; background: transparent; }
.conversation-heading h2 { font-family: var(--font-display); font-size: 24px; letter-spacing: -.04em; }
.conversation-list { border-radius: var(--r-md); }
.conversation-list .rows > .row { padding: 24px; min-height: 110px; border-left: 3px solid transparent; }
.conversation-list .rows > .row:hover { background: var(--mint-soft); color: var(--ink); }
.conversation-list .rows > .row .av { border-radius: 50%; width: 48px; height: 48px; font-size: 16px; }
.conversation-list .rows > .row .m b { font-size: 18px; font-weight: 750; letter-spacing: -.025em; margin-bottom: 6px; }
.conversation-list .rows > .row .m span { max-width: 70ch; font-size: 15.5px; line-height: 1.6; }
.conversation-list .rows > .row .r b { font-size: 13.5px; }
.conversation-list .rows > .row:has(.tag.c) { background: var(--mint-soft); border-left-color: var(--brand); }
.conversation-list .rows > .row:has(.tag.c) .m span { color: var(--ink); }
.conversation-list .rows > .row .tag.c { background: var(--brand); color: var(--brand-ink); }
.conversation-list .rows > .row:has(.tag.c):hover { background: var(--surface-3); }
.cl-root { gap: 18px; }
.cl-filterbar { padding: 18px 0; border-block: 1px solid var(--line); }
.cl-count { font-size: 14px; }
.cl-stats { gap: 0; padding: 8px 0 20px; border-bottom: 1px solid var(--line); }
.cl-stats .stat { background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; padding: 8px 20px; }
.cl-stats .stat:first-child { border-left: 0; padding-left: 0; }
.cl-stats .stat b { font-size: clamp(23px, 2.5vw, 32px); letter-spacing: -.045em; }
.cl-sec { gap: 16px; }
.cl-sec-h { letter-spacing: .075em; padding: 6px 0; }
.cl-cards { grid-template-columns: minmax(0, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.cl-cards .cl-card { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 24px; gap: 14px; background: transparent; }
.cl-cards .cl-card:last-child { border-bottom: 0; }
.cl-cards .cl-card.is-attn { border-left: 3px solid var(--sun); }
.cl-card .cl-who .av { border-radius: 50%; }
.cl-card .cl-id b { font-size: 18px; letter-spacing: -.025em; }
.cl-id .sub { font-size: 13.5px; }
.cl-fact dt { font-size: 13.5px; }
.cl-fact dd { font-size: 16px; }
.cl-facts { gap: 12px 30px; padding-block: 4px; }
.cl-note { background: var(--surface-2); border-radius: var(--r-sm); padding: 12px 16px; line-height: 1.6; }
.cl-note:empty { display: none; }
.cl-actions { gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.cl-tblcard { border-radius: var(--r-md); }
.cl-tbl th { background: transparent; padding-block: 18px; color: var(--muted); font-weight: 650; }
.cl-tbl td { padding-block: 22px; font-size: 15px; }
.cl-tbl .cl-id b { font-size: 17px; letter-spacing: -.025em; }
.cl-tbl td.r > .num { font-size: 17px; }
.cl-tbl .cl-c-act > .btn { min-height: 44px; padding-inline: 18px; }
.cl-tbl .cl-c-act > .btn:not(.pri) { padding-inline: 12px; }
.cl-tbl .cl-who .av { border-radius: 50%; }
.cl-tbl tbody tr:hover { background: var(--mint-soft); }
.cl-tbl tbody tr:hover td { color: var(--ink); }
.cl-bulk { border: 0; border-radius: var(--r-sm); padding: 14px 18px; }
.cl-views-in { padding: 12px 0 0; }
.cl-dlg .cl-totals { background: var(--surface-2); border-radius: var(--r-sm); padding: 16px; gap: 20px; }
.cl-dlg .cl-totals > div { padding: 0; background: transparent; border-radius: 0; }

@media (min-width: 821px) {
  body[data-density="compact"] .conversation-list .rows > .row { min-height: 78px; padding: 14px 20px; }
  body[data-density="compact"] .conversation-list .rows > .row .m b { font-size: 16px; margin-bottom: 3px; }
  body[data-density="compact"] .conversation-list .rows > .row .m span { font-size: 14px; }
  body[data-density="compact"] .conversation-list .rows > .row .av { width: 38px; height: 38px; font-size: 14px; }
  body[data-density="compact"] .cl-tbl td { padding-block: 10px; font-size: 14px; }
  body[data-density="compact"] .cl-tbl .cl-id b, body[data-density="compact"] .cl-tbl td.r > .num { font-size: 15px; }
  body[data-density="compact"] .cl-cards .cl-card { padding: 16px 20px; gap: 10px; }
  body[data-density="compact"] .cl-card .cl-id b { font-size: 16px; }
}

@media (max-width: 820px) {
  .cl-tblcard { background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
  .cl-tbl tr { border: 0; border-bottom: 1px solid var(--line); margin: 0; padding: 20px; border-radius: 0; background: transparent; }
  .cl-tbl tr:last-child { border-bottom: 0; }
  .cl-tbl td { padding: 0; }
  .cl-tbl tr.is-attn { border-left: 3px solid var(--sun); }
  .cl-tbl .cl-c-act { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
}
@media (max-width: 560px) {
  .clients-intro { font-size: 17px; margin-bottom: 18px; }
  .clients-tabs { margin-bottom: 18px; }
  .clients-tabs .pill { padding-inline: 12px; font-size: 15px; }
  .conversation-heading { padding: 18px 16px; }
  .conversation-list .rows > .row { padding: 18px 16px; }
  .conversation-list .rows > .row .av { width: 44px; height: 44px; }
  .conversation-list .rows > .row .m { flex-basis: calc(100% - 58px); }
  .conversation-list .rows > .row .r { padding-left: 54px; }
  .conversation-list .rows > .row .m b { font-size: 17px; }
  .conversation-list .rows > .row .m span { font-size: 15px; }
  .conversation-heading h2 { font-size: 22px; }
  .cl-stats { row-gap: 18px; }
  .cl-stats .stat { padding: 4px 14px; }
  .cl-stats .stat:nth-child(3) { border-left: 0; padding-left: 0; }
  .cl-stats .stat b { font-size: 26px; }
  .cl-cards .cl-card { padding: 20px 16px; }
  .cl-card-top { gap: 14px; }
  .cl-facts { gap: 12px 20px; }
  .cl-actions > .btn { flex: 1 1 130px; }
  .cl-tbl tr { padding: 20px 16px; }
  .cl-tbl .cl-c-act > .btn { flex: 1 1 120px; }
  .cl-dlg .cl-totals { gap: 14px; }
}
