/* cockpit-home.css — F2 · prefixo .ch- · usa os tokens do tema (--bg, --card, --accent, --green...) */

/* ── visão por perfil (applyRoleView) ── */
body.ch-neg .ch-hide-neg,
body.ch-neg #dash-widgets { display: none !important; }
body:not(.ch-mgr) .ch-mgr-only,
body:not(.ch-neg) .ch-neg-only { display: none !important; }
/* ferramentas de gestão dentro do WhatsApp: escondidas para negociador */
body.ch-neg #page-wa [onclick*="showWaTab('blast')"],
body.ch-neg #page-wa [onclick*="showWaTab('regua')"],
body.ch-neg #page-wa [onclick*="showWaTab('abtest')"],
body.ch-neg #page-wa [onclick*="showWaTab('optout')"],
body.ch-neg #page-wa [onclick*="showWaTab('config')"],
body.ch-neg #wa-tab-blast, body.ch-neg #wa-tab-regua, body.ch-neg #wa-tab-abtest,
body.ch-neg #wa-tab-optout, body.ch-neg #wa-tab-config { display: none !important; }
/* pagamentos atrás da flag features.payments */
.ch-pay-only { display: none; }
body.ch-pay .ch-pay-only { display: inline; }

/* ── base ── */
.ch-page { --ch-gap: 14px; font-variant-numeric: tabular-nums; }
.ch-page .card { padding: 16px; }
.ch-head { gap: 16px; flex-wrap: wrap; }
.ch-head-r { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-h2 { font-size: 13px; font-weight: 700; letter-spacing: .02em; text-transform: uppercase; color: var(--muted2); margin: 0; }
.ch-h3 { font-size: 12px; font-weight: 700; color: var(--muted2); margin: 14px 0 6px; text-transform: uppercase; letter-spacing: .03em; }
.ch-sec-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ch-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ch-muted { color: var(--muted); font-size: 12px; }
.ch-r { text-align: right; }
.ch-big { font-size: 34px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; color: var(--text); margin: 4px 0 2px; }
.ch-big small { font-size: 15px; font-weight: 500; color: var(--muted); }
.ch-page kbd, .ch-acard kbd { font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; border: 1px solid var(--border2); border-radius: 3px; background: var(--card2); color: var(--muted2); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.ch-page button:focus-visible, .ch-page [tabindex]:focus-visible, .ch-page input:focus-visible, .ch-page select:focus-visible,
.ch-tv button:focus-visible, .ch-drawer :focus-visible, .ch-nav:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* live dot */
.ch-live { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted2); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
.ch-live i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 0 rgba(34,211,160,.5); animation: chPulse 2s infinite; }
.ch-live.busy i { background: var(--yellow); }
.ch-live.stale i { background: var(--red); animation: none; }
@keyframes chPulse { 0% { box-shadow: 0 0 0 0 rgba(34,211,160,.45); } 70% { box-shadow: 0 0 0 7px rgba(34,211,160,0); } 100% { box-shadow: 0 0 0 0 rgba(34,211,160,0); } }

/* skeleton / estados */
.ch-skel { border-radius: var(--radius); background: linear-gradient(90deg, var(--card) 0%, var(--card2) 50%, var(--card) 100%); background-size: 200% 100%; animation: chSk 1.3s linear infinite; margin-bottom: 8px; }
@keyframes chSk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.ch-state { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 28px 16px; text-align: center; border: 1px dashed var(--border2); border-radius: var(--radius); }
.ch-state-t { font-weight: 600; color: var(--text); }
.ch-state-s { color: var(--muted); font-size: 12.5px; max-width: 440px; }
.ch-state-error { border-color: rgba(240,85,107,.45); background: rgba(240,85,107,.05); }
.ch-state .btn { margin-top: 6px; }
.ch-empty-s { color: var(--muted); font-size: 12.5px; padding: 8px 0; }
.ch-spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border2); border-top-color: var(--accent); animation: chSpin .8s linear infinite; }
@keyframes chSpin { to { transform: rotate(360deg); } }

/* pills / chips / deltas */
.ch-pill { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--border2); color: var(--muted2); white-space: nowrap; }
.ch-pill.good { color: var(--green); border-color: rgba(34,211,160,.35); background: rgba(34,211,160,.08); }
.ch-pill.warn { color: var(--yellow); border-color: rgba(245,178,64,.35); background: rgba(245,178,64,.08); }
.ch-pill.bad { color: var(--red); border-color: rgba(240,85,107,.4); background: rgba(240,85,107,.08); }
.ch-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ch-chip { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--card2); border: 1px solid var(--border); color: var(--muted2); cursor: default; }
button.ch-chip { cursor: pointer; }
.ch-chip.hot { color: #FF6B4A; border-color: rgba(255,107,74,.35); }
.ch-chip.warm { color: var(--yellow); border-color: rgba(245,178,64,.3); }
.ch-chip.cold { color: #7FB6FF; border-color: rgba(127,182,255,.3); }
.ch-chip.bad { color: #fff; background: var(--red); border-color: var(--red); }
.ch-delta { font-weight: 600; color: var(--muted); }
.ch-delta.up { color: var(--green); }
.ch-delta.down { color: var(--red); }

/* tabs / seg */
.ch-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 12px; overflow-x: auto; }
.ch-tabs[hidden], .ch-tab[hidden] { display: none; }
.ch-tab { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 10px; cursor: pointer; white-space: nowrap; }
.ch-tab:hover { color: var(--text); }
.ch-tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.ch-cnt { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 99px; background: var(--card2); font-size: 10.5px; color: var(--muted2); text-align: center; }
.ch-tabs-lg .ch-tab { font-size: 14px; padding: 9px 14px; }
.ch-seg { display: inline-flex; border: 1px solid var(--border2); border-radius: var(--radius); overflow: hidden; }
.ch-seg button { background: transparent; border: 0; color: var(--muted2); font: inherit; font-size: 12px; font-weight: 600; padding: 6px 12px; cursor: pointer; }
.ch-seg button + button { border-left: 1px solid var(--border2); }
.ch-seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.ch-select, .ch-input { background: var(--bg2); border: 1px solid var(--border2); color: var(--text); border-radius: var(--radius); padding: 6px 9px; font: inherit; font-size: 12.5px; min-width: 0; }
.ch-input::placeholder { color: var(--muted); }
.ch-row { display: flex; gap: 8px; }
.ch-row .ch-input { flex: 1; }

/* ── Meu Painel ── */
.ch-top { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--ch-gap); margin-bottom: var(--ch-gap); }
.ch-goal-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ch-goal-pct { font-size: 40px; font-weight: 700; letter-spacing: -.03em; line-height: 1; color: var(--muted2); }
.ch-goal-pct.good { color: var(--green); }
.ch-goal-pct.warn { color: var(--yellow); }
.ch-bar { position: relative; height: 12px; border-radius: 99px; background: var(--card2); border: 1px solid var(--border); margin: 14px 0 12px; overflow: visible; }
.ch-bar-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: var(--accent); transition: width .6s var(--ease, ease); }
.ch-bar-fill.good { background: var(--green); }
.ch-bar-fill.warn { background: linear-gradient(90deg, var(--accent), var(--yellow)); }
.ch-bar-pace { position: absolute; top: -5px; bottom: -5px; width: 2px; background: var(--text); opacity: .75; border-radius: 1px; }
.ch-bar-pace::after { content: 'agora'; position: absolute; top: -15px; left: 50%; transform: translateX(-50%); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ch-goal-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted2); }
.ch-goal-foot b { color: var(--text); }

.ch-rank-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ch-rank-list, .ch-tv-rank ol { list-style: none; margin: 10px 0 0; padding: 0; }
.ch-rank-list li, .ch-tv-rank li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--radius); font-size: 13px; }
.ch-rank-list li + li { border-top: 1px solid var(--border); }
.ch-rank-list li.you { background: rgba(var(--accent-rgb), .12); border: 1px solid rgba(var(--accent-rgb), .45); }
.ch-rank-list li.ch-gap { margin-top: 10px; }
.ch-rank-list li.ch-gap::before { content: '⋯'; position: absolute; margin-top: -26px; margin-left: 4px; color: var(--muted); }
.ch-pos { font-weight: 700; color: var(--muted2); text-align: center; }
.ch-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-nm em { font-style: normal; font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--accent); margin-left: 4px; }
.ch-ag { color: var(--muted); font-size: 12px; }
.ch-val { font-weight: 700; text-align: right; min-width: 78px; }

.ch-kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: var(--ch-gap); margin-bottom: var(--ch-gap); }
body.ch-pay .ch-kpis:not(.ch-kpis-6) { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ch-kpis-6 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.ch-kpi { position: relative; overflow: hidden; }
.ch-kpi-v { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin: 6px 0 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-kpi-s { display: flex; gap: 10px; flex-wrap: wrap; font-size: 11.5px; color: var(--muted); }
.ch-kpi.bad .ch-kpi-v { color: var(--red); }
.ch-kpi.bad::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--red); }

.ch-grid { display: grid; grid-template-columns: minmax(0, 1.9fr) minmax(300px, 1fr); gap: var(--ch-gap); align-items: start; margin-bottom: var(--ch-gap); }
.ch-side { display: flex; flex-direction: column; gap: var(--ch-gap); }
.ch-qlist { display: flex; flex-direction: column; gap: 8px; }
.ch-qcard { display: grid; grid-template-columns: minmax(0, 1fr) 100px 180px 132px; gap: 14px; align-items: center; padding: 11px 12px 11px 14px; border: 1px solid var(--border); border-left: 3px solid var(--border2); border-radius: var(--radius); background: var(--card2); transition: border-color .15s, transform .15s; }
.ch-qcard:hover { border-color: var(--border2); transform: translateX(2px); }
.ch-qcard.b-hot { border-left-color: #FF6B4A; }
.ch-qcard.b-warm { border-left-color: var(--yellow); }
.ch-qcard.b-cold { border-left-color: #7FB6FF; }
.ch-qcard.breached { background: linear-gradient(90deg, rgba(240,85,107,.07), transparent 40%), var(--card2); }
@keyframes chIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.ch-q-l1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ch-q-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-band { flex: none; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 2px 6px; border-radius: 3px; }
.ch-band.b-hot { background: rgba(255,107,74,.15); color: #FF8A6E; }
.ch-band.b-warm { background: rgba(245,178,64,.13); color: var(--yellow); }
.ch-band.b-cold { background: rgba(127,182,255,.12); color: #9CC6FF; }
.ch-q-l2 { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; }
.ch-q-l2 i { font-style: normal; opacity: .6; }
.ch-kind.k-promise_broken { color: var(--red); font-weight: 600; }
.ch-kind.k-promise_due { color: var(--yellow); font-weight: 600; }
.ch-kind.k-approval_ready { color: var(--green); font-weight: 600; }
.ch-q-reason { font-size: 12px; color: var(--muted2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-q-val { font-size: 16px; font-weight: 700; text-align: right; }
.ch-q-wait { font-size: 12px; color: var(--muted2); white-space: nowrap; }
.ch-q-wait.bad { color: var(--red); font-weight: 600; }
.ch-q-wait small { color: var(--muted); font-weight: 400; }
.ch-mini { display: block; height: 4px; border-radius: 2px; background: var(--border); margin-top: 5px; overflow: hidden; }
.ch-mini span { display: block; height: 100%; background: var(--green); border-radius: 2px; }
.breached .ch-mini span { background: var(--red); }
.ch-q-btn { white-space: nowrap; justify-self: end; }
.ch-more { align-self: center; margin-top: 4px; }

.ch-alerts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ch-alerts li { border-left: 3px solid var(--border2); background: var(--card2); border-radius: var(--radius); padding: 7px 10px; font-size: 12.5px; display: flex; flex-direction: column; gap: 2px; }
.ch-alerts li.t-bad { border-left-color: var(--red); }
.ch-alerts li.t-warn { border-left-color: var(--yellow); }
.ch-alerts li.t-good { border-left-color: var(--green); }
.ch-alerts li span { color: var(--muted2); }
.ch-alert-btn { all: unset; display: flex; flex-direction: column; gap: 2px; cursor: pointer; width: 100%; }
.ch-alert-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.ch-alert-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ch-alert-acts { display: flex; gap: 4px; flex: none; }

.ch-chart { width: 100%; height: auto; display: block; }
.ch-c-bar { fill: var(--border2); transition: fill .15s; }
.ch-c-bar:hover { fill: var(--muted); }
.ch-c-today { fill: var(--accent); }
.ch-c-lbl { fill: var(--muted); font-size: 9.5px; text-anchor: middle; font-family: var(--font-sans); }
.ch-c-val { fill: var(--muted2); font-size: 9px; text-anchor: middle; font-family: var(--font-sans); }

/* ── Aprovações ── */
.ch-alist { display: flex; flex-direction: column; gap: 10px; max-width: 1100px; }
.ch-acard { outline: none; transition: border-color .15s, box-shadow .15s, opacity .2s, transform .2s; animation: chIn .25s ease both; }
.ch-page .ch-acard.sel { outline: 2px solid rgba(var(--accent-rgb), .75); outline-offset: -1px; }
.ch-acard.busy { opacity: .6; pointer-events: none; }
.ch-acard.ch-out { opacity: 0; transform: translateX(24px); }
.ch-a-h { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.ch-a-name { font-size: 16px; font-weight: 700; }
.ch-a-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.ch-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ch-cell span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ch-cell b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch-cell.bad b { color: var(--red); }
.ch-scale { position: relative; height: 6px; border-radius: 3px; background: var(--card2); margin: 22px 0 26px; }
.ch-scale-req { position: absolute; left: 0; top: 0; bottom: 0; background: var(--green); border-radius: 3px; }
.ch-scale-req.over { background: linear-gradient(90deg, var(--yellow), var(--red)); }
.ch-scale i { position: absolute; top: -6px; bottom: -6px; width: 2px; background: var(--text); opacity: .7; }
.ch-scale i b { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); font-size: 9.5px; font-weight: 600; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.ch-scale i.m-auth { background: var(--yellow); }
/* rótulos em lados opostos da régua: POLÍTICA em cima, ALÇADA embaixo — nunca se sobrepõem, mesmo com marcadores próximos ou iguais */
.ch-scale i.m-auth b { bottom: auto; top: 16px; color: var(--yellow); }
.ch-scale i.edge-l b { left: 0; transform: none; }
.ch-scale i.edge-r b { left: auto; right: 0; transform: none; }
.ch-a-why { font-size: 12.5px; color: var(--muted2); margin-bottom: 12px; }
.ch-a-why .bad { color: var(--red); }
.ch-a-note { margin-top: 6px; padding: 8px 10px; background: var(--card2); border-radius: var(--radius); color: var(--text); font-style: italic; }
.ch-a-act { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ch-a-act .ch-input { flex: 1; min-width: 200px; }
.ch-rej:hover { border-color: rgba(240,85,107,.6) !important; color: var(--red); }
.ch-money { display: inline-flex; align-items: center; gap: 6px; }
.ch-money .ch-input { width: 120px; min-width: 0; flex: none; }

/* ── Desempenho ── */
.ch-grid-team { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.ch-funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ch-funnel li { display: grid; grid-template-columns: 90px minmax(0, 1fr) 60px 44px; gap: 10px; align-items: center; font-size: 13px; }
.ch-funnel b { text-align: right; }
.ch-f-l { color: var(--muted2); }
.ch-f-bar { height: 18px; background: var(--card2); border-radius: 3px; overflow: hidden; }
.ch-f-bar span { display: block; height: 100%; background: linear-gradient(90deg, rgba(var(--accent-rgb), .9), rgba(var(--accent-rgb), .55)); border-radius: 3px; transition: width .5s ease; }
.ch-f-conv { color: var(--muted); font-size: 11.5px; text-align: right; }
.ch-tablewrap { overflow-x: auto; }
.ch-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ch-table th { text-align: left; padding: 0; border-bottom: 1px solid var(--border2); position: sticky; top: 0; background: var(--card); }
.ch-table th.num { text-align: right; }
.ch-table th button { all: unset; cursor: pointer; display: block; padding: 8px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted2); white-space: nowrap; }
.ch-table th button:focus-visible { outline: 2px solid var(--accent); }
.ch-table th[aria-sort="ascending"] button, .ch-table th[aria-sort="descending"] button { color: var(--text); }
.ch-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.ch-table td.num { text-align: right; }
.ch-table tbody tr:hover td { background: rgba(255,255,255,.02); }
.ch-out-bad { color: var(--red); font-weight: 700; background: rgba(240,85,107,.07); }
.ch-out-good { color: var(--green); font-weight: 700; background: rgba(34,211,160,.06); }
.ch-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; vertical-align: middle; }
.ch-dot.on { background: var(--green); box-shadow: 0 0 6px rgba(34,211,160,.6); }
.ch-dot.off { background: var(--border2); }

/* drawer QA */
.ch-drawer-wrap { position: fixed; inset: 0; z-index: 9000; background: rgba(0,0,0,.55); display: flex; justify-content: flex-end; animation: chFade .15s ease; }
.ch-drawer { width: min(480px, 100%); height: 100%; overflow-y: auto; background: var(--surface); border-left: 1px solid var(--border2); padding: 20px; animation: chSlide .2s ease; }
@keyframes chFade { from { opacity: 0; } }
@keyframes chSlide { from { transform: translateX(30px); opacity: .4; } }
.ch-qa-form { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.ch-qa-sug { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 6px; }
.ch-qa-score { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.ch-qa-score svg { width: 72px; height: 72px; transform: rotate(-90deg); }
.ch-qa-score circle { fill: none; stroke-width: 3.2; }
.ch-qa-score .bg { stroke: var(--card2); }
.ch-qa-score .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dasharray .6s ease; }
.ch-qa-score.good .fg { stroke: var(--green); }
.ch-qa-score.warn .fg { stroke: var(--yellow); }
.ch-qa-score.bad .fg { stroke: var(--red); }
.ch-qa-score b { display: block; font-size: 30px; font-weight: 700; line-height: 1; }
.ch-qa-score span { font-size: 12px; color: var(--muted); }
.ch-qa-dims { display: flex; flex-direction: column; gap: 6px; }
.ch-qa-dim { display: grid; grid-template-columns: 96px minmax(0, 1fr) 30px; gap: 8px; align-items: center; font-size: 12.5px; }
.ch-qa-dim .ch-mini { margin: 0; height: 6px; }
.ch-qa-dim b { text-align: right; }
.ch-coach { margin: 0; padding-left: 18px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; color: var(--text); }

/* ── Telão ── */
.ch-tv { position: fixed; inset: 0; z-index: 9500; background: var(--bg); color: var(--text); display: flex; flex-direction: column; padding: 2.2vh 2.4vw; gap: 2vh; font-variant-numeric: tabular-nums; overflow: hidden; }
.ch-tv-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ch-tv-brand { display: flex; align-items: center; gap: 14px; font-size: clamp(14px, 1.4vw, 22px); font-weight: 600; color: var(--muted2); }
.ch-tv-clock { font-size: clamp(22px, 2.6vw, 44px); font-weight: 700; letter-spacing: -.02em; margin-left: auto; }
.ch-tv-body { flex: 1; display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: 1fr auto; gap: 2vh 2vw; min-height: 0; }
.ch-tv-goal, .ch-tv-rank, .ch-tv-alerts { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius2); padding: 2.4vh 1.8vw; min-height: 0; overflow: hidden; }
.ch-tv-rank { grid-row: span 2; }
.ch-tv-l { font-size: clamp(13px, 1.2vw, 20px); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.ch-tv-big { font-size: clamp(44px, 6.4vw, 120px); font-weight: 700; letter-spacing: -.03em; line-height: 1.05; }
.ch-tv-meta { font-size: clamp(14px, 1.4vw, 24px); color: var(--muted2); }
.ch-tv-meta b { color: var(--text); }
.ch-bar-xl { height: 2.2vh; min-height: 14px; margin: 1.6vh 0 2.2vh; }
.ch-tv-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 1vw; }
.ch-tv-stats div { display: flex; flex-direction: column; }
.ch-tv-stats b { font-size: clamp(22px, 2.6vw, 48px); font-weight: 700; }
.ch-tv-stats span { font-size: clamp(11px, .9vw, 15px); color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ch-tv-stats .bad b { color: var(--red); }
.ch-tv-sub { font-size: clamp(12px, 1vw, 17px); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 2.4vh 0 1.2vh; font-weight: 700; }
.ch-tv-rank .ch-tv-sub, .ch-tv-alerts .ch-tv-sub { margin-top: 0; }
.ch-tv-rank li { font-size: clamp(14px, 1.45vw, 26px); padding: 1vh .8vw; grid-template-columns: 2.4em 14px minmax(0, 1fr) auto auto; }
.ch-tv-rank li + li { border-top: 1px solid var(--border); }
.ch-tv-rank li.podium .ch-pos { color: var(--bg); border-radius: 50%; width: 1.7em; height: 1.7em; line-height: 1.7em; font-size: .85em; }
.ch-tv-rank li.p1 .ch-pos { background: #F5C451; }
.ch-tv-rank li.p2 .ch-pos { background: #C9D1DB; }
.ch-tv-rank li.p3 .ch-pos { background: #D79A6A; }
.ch-tv-rank li.p1 { background: rgba(245,196,81,.07); }
.ch-funnel-xl li { font-size: clamp(13px, 1.2vw, 22px); grid-template-columns: 8em minmax(0, 1fr) 4em; }
.ch-funnel-xl .ch-f-bar { height: 2.2vh; min-height: 14px; }
.ch-tv-alerts ul { margin: 0; padding-left: 1.1em; font-size: clamp(13px, 1.15vw, 20px); color: var(--muted2); display: flex; flex-direction: column; gap: .8vh; }

/* ── responsivo: ≥1280 cheio · 1024–1279 degrada ── */
@media (max-width: 1279px) {
  .ch-kpis, body.ch-pay .ch-kpis:not(.ch-kpis-6) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-grid { grid-template-columns: minmax(0, 1fr); }
  .ch-side { flex-direction: row; }
  .ch-side > * { flex: 1; min-width: 0; }
  .ch-qcard { grid-template-columns: minmax(0, 1fr) 100px auto; }
  .ch-q-sla { display: none; }
  .ch-a-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ch-grid-team { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .ch-top { grid-template-columns: minmax(0, 1fr); }
  .ch-side { flex-direction: column; }
  .ch-kpis, body.ch-pay .ch-kpis:not(.ch-kpis-6) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ch-tv-body { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .ch-page *, .ch-tv *, .ch-drawer-wrap * { animation: none !important; transition: none !important; }
}

/* próxima ação (cartão da meta) */
.ch-goal { display: flex; flex-direction: column; }
.ch-next { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--border); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 18px; align-items: center; }
.ch-next:empty { display: none; }
.ch-next-stats { display: flex; gap: 18px; }
.ch-next-stats div { display: flex; flex-direction: column; }
.ch-next-stats b { font-size: 22px; font-weight: 700; line-height: 1.1; }
.ch-next-stats span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ch-next-stats .bad b { color: var(--red); }
.ch-next-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: var(--radius); background: rgba(var(--accent-rgb), .07); border: 1px solid rgba(var(--accent-rgb), .25); min-width: 0; }
.ch-next-txt { display: flex; flex-direction: column; min-width: 0; }
.ch-next-txt b, .ch-next-txt .ch-muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1279px) { .ch-next { grid-template-columns: minmax(0, 1fr); } }

/* o tema global do backoffice força padding/altura em td/th/.btn com !important — tabela densa precisa vencer */
.ch-page .ch-table th, .ch-page .ch-table td { padding: 7px 10px !important; height: auto !important; line-height: 1.35 !important; }
.ch-page .ch-table th { background: var(--card) !important; padding: 0 !important; }
.ch-page .ch-table th button { padding: 9px 10px !important; }
.ch-page .ch-table td { font-size: 13px !important; }
.ch-page .ch-table .btn { height: 28px !important; min-height: 0 !important; padding: 0 10px !important; font-size: 12px !important; }
.ch-page .ch-table td.ch-out-bad { background: rgba(240,85,107,.08) !important; }
.ch-page .ch-table td.ch-out-good { background: rgba(34,211,160,.07) !important; }
.ch-kpis-6 .ch-kpi-v { font-size: clamp(18px, 1.55vw, 24px); }
.ch-kpis-6 .ch-kpi { padding: 14px !important; }
.ch-page .ch-table td:first-child { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.ch-page .ch-table th button { letter-spacing: .02em !important; }
.ch-qa-dim.warn .ch-mini span { background: var(--yellow); }
.ch-qa-dim.bad .ch-mini span { background: var(--red); }
