/* Inteligência de relacionamento: alta densidade, uma ação clara por cliente. */
.crm-field-row{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.crm-kpis{display:grid;grid-template-columns:repeat(5,minmax(140px,1fr));gap:8px;margin:0 0 10px}
.crm-kpis button{min-width:0;text-align:left;border:1px solid var(--line);background:#fff;border-radius:12px;padding:10px 12px;cursor:pointer;color:inherit}
.crm-kpis button:hover,.crm-kpis button:focus-visible{border-color:#d4a4aa;box-shadow:0 3px 12px rgba(61,35,43,.06)}
.crm-kpis button.on{background:var(--rose-pale);border-color:var(--rose)}
.crm-kpis b{display:block;font-size:20px;line-height:1.1}.crm-kpis span{display:block;font-weight:750;margin-top:3px}
.crm-kpis small{display:block;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-client-row{cursor:pointer}.crm-client-row td{vertical-align:middle}.crm-client-row td>small{display:block;color:var(--muted);margin-top:3px;max-width:250px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.crm-client-row:focus-visible{outline:2px solid var(--rose);outline-offset:-2px}
.crm-client-row .selo{display:inline-flex}.crm-due b{color:var(--rose-deep)}
.crm-consent{display:inline-flex;border-radius:999px;padding:4px 8px;font-size:11px;font-weight:700;background:#f3f0f1;color:#756970}
.crm-consent.granted{background:#e7f4ed;color:#2c7452}.crm-consent.revoked{background:#f8e9eb;color:#a23e48}
.crm-mobile-action{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:9px;padding:9px;margin:8px 0}
.crm-mobile-action span{font-size:11.5px;color:var(--muted);margin-top:2px}.crm-mobile-action.due{background:var(--rose-pale);border-color:#e8c4c9}

.crm-client-drawer{width:min(700px,100vw)}
.crm-client-drawer .dr-body{padding:0 18px 22px}
.crm-hero{display:flex;justify-content:space-between;gap:18px;padding:18px 0;border-bottom:1px solid var(--line)}
.crm-hero>div:first-child{display:flex;align-items:center;gap:12px}.crm-hero h3{margin:0 0 3px;font-size:20px}.crm-hero p{margin:0;color:var(--muted)}
.crm-avatar{width:48px;height:48px;border-radius:50%;display:grid;place-items:center;background:#9cb9cc;color:#fff;font-weight:800}
.crm-state{text-align:right;display:flex;align-items:flex-end;flex-direction:column;gap:5px}.crm-state span:last-child{max-width:270px;color:var(--muted);font-size:12px}
.crm-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);border:1px solid var(--line);border-radius:12px;overflow:hidden;margin:14px 0}
.crm-metrics div{background:#fff;padding:12px}.crm-metrics b,.crm-metrics span{display:block}.crm-metrics b{font-size:16px}.crm-metrics span{color:var(--muted);font-size:11px;margin-top:2px}
.crm-priority{display:flex;justify-content:space-between;align-items:center;gap:12px;border:1px solid #d9e6df;background:#f3faf6;border-radius:12px;padding:13px 14px;margin:14px 0}
.crm-priority.due{background:var(--rose-pale);border-color:#e8c4c9}.crm-priority small,.crm-block small{font-size:10px;letter-spacing:.08em;color:var(--muted)}
.crm-priority h4,.crm-block h4{margin:3px 0 2px;font-size:14px}.crm-priority p,.crm-block p{margin:0;color:var(--muted);font-size:12px}
.crm-action-editor{border:1px solid var(--line);border-radius:12px;padding:13px;margin:-6px 0 14px;background:#fff}
.crm-editor-actions{display:flex;justify-content:flex-end;gap:8px}
.crm-block{border-top:1px solid var(--line);padding:15px 0}.crm-block>header{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin-bottom:7px}
.crm-block header>span{color:var(--muted);font-size:11px}.crm-block select{max-width:190px}
.crm-date-line{display:flex;justify-content:space-between;margin-top:10px;padding:8px 10px;border-radius:8px;background:#f7f5f6;font-size:12px}
.crm-timeline{position:relative;margin-top:10px}.crm-timeline:before{content:"";position:absolute;left:6px;top:9px;bottom:9px;width:1px;background:var(--line)}
.crm-timeline button{position:relative;width:100%;display:flex;gap:11px;text-align:left;border:0;background:none;padding:6px 0;color:inherit}
.crm-timeline button:not(:disabled){cursor:pointer}.crm-timeline button:not(:disabled):hover b{text-decoration:underline}
.crm-timeline i{position:relative;z-index:1;width:13px;height:13px;border-radius:50%;margin-top:2px;background:#fff;border:3px solid #9bb7a7;flex:0 0 auto}
.crm-timeline .msg i{border-color:#a9bcca}.crm-timeline b,.crm-timeline small{display:block}.crm-timeline small{color:var(--muted);margin-top:2px;font-size:11.5px}
.crm-client-foot{display:flex}.crm-client-foot .btn:last-child{margin-left:auto}

.crm-wa-action{display:flex;flex-direction:column;gap:2px;margin:10px 12px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#fff}
.crm-wa-action.due{background:var(--rose-pale);border-color:#e8c4c9}.crm-wa-action small{font-size:9px;letter-spacing:.08em;color:var(--muted)}
.crm-wa-action span{font-size:11px;color:var(--muted)}.crm-wa-action button{align-self:flex-start;border:0;background:none;color:var(--rose-deep);font-weight:700;padding:4px 0;cursor:pointer}
.crm-auto-queue{border:1px solid var(--line);border-radius:14px;background:#fff;margin-bottom:14px;overflow:hidden}
.crm-auto-queue>header{display:flex;justify-content:space-between;align-items:center;padding:13px 15px;background:#fbf8f9;border-bottom:1px solid var(--line)}
.crm-auto-queue h3{margin:2px 0 0;font-size:16px}.crm-auto-queue header small{color:var(--muted);letter-spacing:.08em}.crm-auto-queue header>b{font-size:22px}
.crm-auto-queue>button{display:flex;width:100%;justify-content:space-between;align-items:center;text-align:left;border:0;border-bottom:1px solid var(--line);background:#fff;padding:10px 15px;cursor:pointer;color:inherit}
.crm-auto-queue>button:hover{background:#fdfafb}.crm-auto-queue>button:last-child{border-bottom:0}.crm-auto-queue button span b,.crm-auto-queue button span small{display:block}.crm-auto-queue button small{color:var(--muted);margin-top:2px}
.crm-auto-queue em{font-style:normal;font-size:11px;font-weight:700;color:var(--rose-deep);background:var(--rose-pale);padding:4px 7px;border-radius:999px}

@media(max-width:1050px){.crm-kpis{grid-template-columns:repeat(3,1fr)}}
@media(max-width:700px){
  .crm-field-row{grid-template-columns:1fr}.crm-kpis{display:flex;overflow-x:auto;padding-bottom:4px}.crm-kpis button{min-width:155px}
  .crm-hero{flex-direction:column}.crm-state{align-items:flex-start;text-align:left}.crm-metrics{grid-template-columns:repeat(2,1fr)}
  .crm-client-foot{display:grid;grid-template-columns:1fr 1fr}.crm-client-foot .btn:last-child{margin:0;grid-column:1/-1}
}
