/* Klugwerk Praxis · demonstração: Relacionamento (CRM) e Relatórios. Usa as variáveis de app.css. */
/* Relacionamento */
.crm-seg, .crm-etapas-cel { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.crm-seg::-webkit-scrollbar, .crm-etapas-cel::-webkit-scrollbar { display: none; }
.crm-seg button, .crm-etapas-cel button { flex: none; border: 1px solid var(--linha); background: var(--sup); border-radius: 999px; padding: 6px 13px; cursor: pointer; font-weight: 600; color: var(--aco); white-space: nowrap; }
.crm-seg button[aria-selected="true"], .crm-etapas-cel button[aria-selected="true"] { border-color: var(--px); background: var(--px-suave); color: var(--px); }
.crm-etapas-cel b { font-variant-numeric: tabular-nums; margin-left: 2px; }
.crm-hoje { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 14px; align-items: start; }
.crm-hoje h2 { display: flex; align-items: center; gap: 8px; }
.crm-lista { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.crm-li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--linha); }
.crm-li:first-child { border-top: 0; }
.crm-li > div { min-width: 0; }
.crm-li small { display: block; color: var(--aco); font-size: .82rem; }
.crm-atraso { color: var(--mal); font-weight: 600; }
.crm-funil { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: start; }
.crm-col { background: var(--sup); border: 1px solid var(--linha); border-radius: 8px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: 70vh; overflow-y: auto; }
.crm-col h3 { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: .9rem; position: sticky; top: -10px; background: var(--sup); padding: 2px 0 6px; }
.crm-col.fim { background: var(--bg); }
.crm-cartao { text-align: left; border: 1px solid var(--linha); border-left: 3px solid var(--px); background: var(--sup); border-radius: 6px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; gap: 3px; width: 100%; }
.crm-col.fim .crm-cartao { border-left-color: var(--aco); }
.crm-cartao small { color: var(--aco); font-size: .8rem; }
.crm-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.crm-vazio { text-align: center; padding: 10px 0; }
.crm-etapas-cel { display: none; }
@media (max-width: 899px) {
  .crm-etapas-cel { display: flex; }
  .crm-funil { grid-template-columns: 1fr; }
  .crm-funil .crm-col { display: none; max-height: none; }
  .crm-funil .crm-col.on { display: flex; }
  .crm-col h3 { position: static; }
}
.crm-filtros { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); gap: 10px; align-items: end; }
.crm-busca { grid-column: 1 / -1; }
@media (min-width: 900px) { .crm-busca { grid-column: span 2; } }
.crm-chk { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.crm-chk label { display: flex; gap: 6px; align-items: center; color: var(--tinta); font-weight: 500; margin: 0; }
.crm-tab tbody tr { cursor: pointer; }
.crm-tab tbody tr:hover, .crm-tab tbody tr:focus-visible { background: var(--px-suave); }
.crm-tab td small { display: block; }
.crm-tab .pill { margin: 1px 0; }
@media (max-width: 640px) { .crm-oc { display: none; } .crm-tab th, .crm-tab td { padding: 8px; } }
.crm-pag { display: flex; justify-content: center; align-items: center; gap: 12px; }
.crm-msg { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 860px) { .crm-msg { grid-template-columns: 1fr; } }
.crm-previa { background: var(--ok-s); border-radius: 8px 8px 8px 2px; padding: 10px 12px; max-width: 34rem; }
.crm-previa p { white-space: pre-line; margin-top: 4px; }
.crm-origem { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 14px; align-items: start; }
.crm-ficha { margin: 4px 0; }
.crm-etq-in { width: auto !important; flex: 1 1 10rem; min-width: 8rem; padding: 4px 8px !important; font-size: .85rem; }
.crm-notas, .crm-hist { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: .88rem; }
.crm-notas li { border-left: 3px solid var(--linha); padding-left: 10px; }
.crm-notas small, .crm-hist small { display: block; }
/* Relatórios */
.rel-casca { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 900px) { .rel-casca { grid-template-columns: 1fr; } .rel-lista { order: 2; } }
.rel-lista { display: flex; flex-direction: column; padding: 8px 0; }
.rel-lista h2 { font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--aco); padding: 8px 14px 4px; }
.rel-item { text-align: left; background: none; border: 0; border-left: 3px solid transparent; padding: 8px 14px; cursor: pointer; }
.rel-item small { display: block; color: var(--aco); font-size: .8rem; }
.rel-item[aria-current="true"] { background: var(--px-suave); border-left-color: var(--px); }
.rel-direita { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.rel-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 10px; }
.rel-filtros { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rel-filtros select { width: auto; max-width: 100%; padding: 4px 8px; font-size: .85rem; }
.rel-comp { display: flex; gap: 6px; align-items: center; color: var(--tinta); font-weight: 500; margin: 0 0 0 auto; font-size: .88rem; }
.rel-topo { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: start; }
.rel-total { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; text-align: right; }
.rel-total b { font-family: var(--f-tit); font-size: 1.9rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.rel-total small { color: var(--aco); }
@media (max-width: 560px) { .rel-total { align-items: flex-start; text-align: left; } }
.rel-graf { overflow-x: auto; }
.rel-vbarras { position: relative; display: grid; grid-template-columns: repeat(var(--n), minmax(38px, 1fr)); gap: 4px; min-width: calc(var(--n) * 42px); height: 230px; align-items: stretch; }
.rel-vc { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 3px; text-align: center; min-width: 0; }
.rel-vv { font-size: .74rem; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-vt { display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--linha); }
.rel-vt i { display: block; width: 64%; background: var(--px); border-radius: 3px 3px 0 0; }
.rel-vr { font-size: .74rem; color: var(--aco); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rel-vbarras.linha .rel-vv { visibility: visible; }
.rel-traco { position: absolute; left: 0; right: 0; top: calc(1.2rem + 3px); height: calc(100% - 2.6rem - 6px); width: 100%; pointer-events: none; overflow: visible; }
.rel-traco polyline { fill: none; stroke: var(--px); stroke-width: 2.5; stroke-linejoin: round; }
.rel-hbarras { display: flex; flex-direction: column; gap: 8px; }
.rel-hb { display: grid; grid-template-columns: minmax(0, 13rem) minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: .9rem; }
.rel-hb-r { overflow-wrap: anywhere; }
.rel-hb-t { background: var(--bg); border-radius: 4px; height: 14px; overflow: hidden; }
.rel-hb-t i { display: block; height: 100%; background: var(--px); border-radius: 4px; }
.rel-hb-t i.mal { background: var(--mal); }
.rel-hb b { font-variant-numeric: tabular-nums; min-width: 3.5rem; text-align: right; }
@media (max-width: 560px) { .rel-hb { grid-template-columns: minmax(0, 1fr) auto; } .rel-hb-t { grid-column: 1 / -1; grid-row: 2; } }
.rel-tab summary { cursor: pointer; font-weight: 600; color: var(--px); }
.rel-tab .tab { margin-top: 8px; }
.rel-acoes { align-items: center; }
.rel-acoes #rel-nome { width: auto; flex: 1 1 12rem; }
.rel-acoes .rel-comp { margin: 0; flex-basis: 100%; }
