/* Painel · Conformidade, Atendimento e Relatórios (views/admin/compliance.js, support.js, reports.js). */

/* Paleta dos gráficos (categórica validada; claro e escuro escolhidos para cada superfície). */
:root{--rep-s1:#2a78d6;--rep-s2:#eb6834;--rep-s3:#1baf7a}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--rep-s1:#3987e5;--rep-s2:#d95926;--rep-s3:#199e70}}
:root[data-theme="dark"]{--rep-s1:#3987e5;--rep-s2:#d95926;--rep-s3:#199e70}

/* ---------- comuns ---------- */
.gov-back{align-self:flex-start}
.gov-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(340px,1fr));gap:14px}
.gov-card{padding:16px 18px;display:flex;flex-direction:column;gap:12px;min-width:0}
.gov-card.late{border-color:var(--bad);box-shadow:inset 3px 0 0 var(--bad),var(--shadow)}
.gov-card-h{display:flex;justify-content:space-between;gap:10px;align-items:flex-start;flex-wrap:wrap}
.gov-card-h h3{font-size:15.5px;line-height:1.3}
.gov-card-h .row{gap:6px;flex-wrap:wrap}
a.gov-link{text-decoration:none;color:inherit}
a.gov-link:hover{border-color:var(--ink-2)}
.gov-quote{background:var(--surface-2);border-radius:14px;padding:10px 12px;font-size:14px;display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}
.gov-quote.resp{background:var(--primary-soft)}
.gov-gap{margin-top:10px}
.gov-code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;background:var(--surface-2);padding:1px 6px;border-radius:6px}
.adm-actions.nowrap{flex-wrap:nowrap}
.adm-actions.gov-col{flex-direction:column;align-items:stretch}
.adm-actions.gov-col .btn{justify-content:flex-start}
.gov-pre{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.55}
.adm-tbl tr.gov-late td:first-child{box-shadow:inset 3px 0 0 var(--bad)}
.gov-form{display:flex;flex-direction:column;gap:14px}
.gov-row3{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px}
.gov-editor{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px;align-items:stretch}
.gov-editor textarea{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:13px;line-height:1.55}
.gov-preview{border:1px solid var(--line);border-radius:16px;padding:12px 16px;background:var(--surface-solid);max-height:620px;overflow:auto;display:flex;flex-direction:column;gap:8px}
.gov-md{font-size:14.5px;line-height:1.6;overflow-wrap:anywhere}
.gov-md h2{font-size:18px;margin:14px 0 6px}.gov-md h3{font-size:16px;margin:12px 0 4px}.gov-md h4,.gov-md h5{font-size:14.5px;margin:10px 0 4px}
.gov-md p{margin:0 0 10px}.gov-md ul,.gov-md ol{margin:0 0 10px;padding-left:22px}
.gov-md blockquote{margin:0 0 10px;padding:6px 12px;border-left:3px solid var(--line);color:var(--ink-2)}
.gov-md code{font-family:ui-monospace,Menlo,monospace;font-size:12.5px;background:var(--surface-2);padding:1px 5px;border-radius:6px}

/* Prazo da ANPD */
.gov-count{display:flex;gap:14px;align-items:center;padding:14px 18px;border-radius:var(--r);border:1px solid var(--line)}
.gov-count .i{width:26px;height:26px;flex:none}
.gov-count div{display:flex;flex-direction:column;gap:4px}
.gov-count b{font-size:16px}
.gov-count.warn{background:var(--warn-soft)}.gov-count.warn .i{color:var(--warn)}
.gov-count.bad{background:var(--bad-soft)}.gov-count.bad .i{color:var(--bad)}
.gov-count.ok{background:var(--good-soft)}.gov-count.ok .i{color:var(--good)}

/* Linha do tempo */
.gov-inline{display:flex;gap:10px;align-items:flex-end;margin-bottom:14px}
.gov-inline textarea{flex:1;min-height:64px;border-radius:14px;border:1px solid var(--line);padding:10px 12px;resize:vertical;color:var(--ink)}
.gov-timeline{list-style:none;margin:0;padding:0 0 0 14px;border-left:2px solid var(--line);display:flex;flex-direction:column;gap:12px}
.gov-timeline li{position:relative;display:flex;flex-direction:column;gap:2px;font-size:14px}
.gov-timeline li::before{content:"";position:absolute;left:-20px;top:5px;width:10px;height:10px;border-radius:999px;background:var(--surface-solid);border:2px solid var(--primary)}
.gov-timeline p{overflow-wrap:anywhere}
.gov-export{display:flex;gap:10px;align-items:flex-end;flex-wrap:wrap}

/* ---------- atendimento ---------- */
.sup-thread{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.sup-msg{padding:12px 14px;border-radius:16px;border:1px solid var(--line);background:var(--surface-solid);max-width:88%;display:flex;flex-direction:column;gap:6px}
.sup-msg p{font-size:14.5px;line-height:1.55;overflow-wrap:anywhere}
.sup-msg.staff{align-self:flex-end;background:var(--primary-soft);border-color:transparent}
.sup-msg.internal{align-self:stretch;max-width:none;background:var(--warn-soft);border:1px dashed var(--warn)}
.sup-msg-h{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:13px}
.sup-msg-h .i{width:16px;height:16px;color:var(--ink-2)}
.sup-msg-h .meta{margin-left:auto}
.sup-reply{display:flex;flex-direction:column;gap:10px}
.sup-reply textarea{width:100%;border-radius:14px;border:1px solid var(--line);padding:12px 14px;resize:vertical;color:var(--ink);font-size:14.5px}
.sup-reply textarea:focus{outline:2px solid var(--primary);border-color:transparent}
.sup-reply-f{display:flex;gap:10px;align-items:flex-end;justify-content:space-between;flex-wrap:wrap}
.sup-reply-f .meta{display:inline-flex;gap:6px;align-items:center}
.sup-reply-f .meta .i{width:14px;height:14px}
.sup-kb{list-style:none;margin:0;padding:0}
.sup-kb li{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:12px 18px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.sup-kb li:last-child{border-bottom:0}
.sup-kb a{display:flex;flex-direction:column;gap:3px;color:inherit;text-decoration:none;min-width:0;flex:1 1 320px}
.sup-kb a:hover b{text-decoration:underline}
.sup-kb .row{gap:6px;flex-wrap:wrap;align-items:center}

/* ---------- gráficos ---------- */
.rep-chart{margin:0;display:flex;flex-direction:column;gap:10px;outline:none;border-radius:12px}
.rep-chart:focus-visible{outline:2px solid var(--primary);outline-offset:4px}
.rep-plot{position:relative}
.rep-chart svg{display:block;overflow:visible;max-width:100%}
.rep-chart .g{stroke:var(--line);stroke-width:1}
.rep-chart .ax{font-size:11px;fill:var(--ink-2);font-family:var(--body);font-variant-numeric:tabular-nums}
.rep-chart .dl{font-size:11.5px;fill:var(--ink);font-family:var(--body)}
.rep-chart .ln{fill:none;stroke-width:2;stroke-linejoin:round;stroke-linecap:round}
.rep-chart .key{stroke-width:2;stroke-linecap:round}
.rep-chart .s1{stroke:var(--rep-s1)}.rep-chart .s2{stroke:var(--rep-s2)}.rep-chart .s3{stroke:var(--rep-s3)}
.rep-chart .dot{stroke:var(--surface-solid);stroke-width:2}
.rep-chart .dot.s1{fill:var(--rep-s1)}.rep-chart .dot.s2{fill:var(--rep-s2)}.rep-chart .dot.s3{fill:var(--rep-s3)}
.rep-chart .xh{stroke:var(--ink-2);stroke-width:1;stroke-dasharray:3 3}
.rep-chart .hit{fill:transparent;cursor:crosshair}
.rep-tip{position:absolute;top:6px;z-index:2;pointer-events:none;background:var(--surface-solid);border:1px solid var(--line);box-shadow:var(--shadow);border-radius:12px;padding:8px 12px;font-size:13px;min-width:120px;display:flex;flex-direction:column;gap:3px}
.rep-tip p{display:flex;align-items:center;gap:6px;white-space:nowrap}
.rep-tip b{font-variant-numeric:tabular-nums}
.rep-tip span{color:var(--ink-2)}
.rep-tip i,.rep-legend i{display:inline-block;width:14px;height:2px;border-radius:2px;flex:none}
.rep-tip i.s1,.rep-legend i.s1{background:var(--rep-s1)}.rep-tip i.s2,.rep-legend i.s2{background:var(--rep-s2)}.rep-tip i.s3,.rep-legend i.s3{background:var(--rep-s3)}
.rep-legend{display:flex;gap:16px;flex-wrap:wrap;font-size:12.5px;color:var(--ink-2)}
.rep-legend span{display:inline-flex;align-items:center;gap:6px}
.rep-legend i{width:16px;height:3px}
.rep-tbl summary{cursor:pointer;font-size:12.5px;color:var(--ink-2)}
.rep-tbl .tbl-wrap{max-height:280px;overflow:auto;margin-top:8px}
.rep-tbl .tbl{min-width:0}

/* ---------- exportações ---------- */
.rep-sets{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.rep-set{padding:14px 16px;display:flex;flex-direction:column;justify-content:space-between;gap:12px}
.rep-set h3{font-size:15px}
.rep-set.off{opacity:.7}
.rep-set .btn,.rep-set .chip-s{align-self:flex-start}

/* ---------- relatório de transparência ---------- */
.rep-doc{padding:26px 28px;display:flex;flex-direction:column;gap:22px}
.rep-doc header h2{font-family:var(--display);font-size:clamp(18px,2vw,24px);margin-top:4px}
.rep-doc section{display:flex;flex-direction:column;gap:10px;padding-top:18px;border-top:1px solid var(--line)}
.rep-doc h3{font-size:16px}
.rep-doc h4{font-size:13px;color:var(--ink-2);text-transform:uppercase;letter-spacing:.06em;font-weight:600}
.rep-figs{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.rep-fig{background:var(--surface-2);border-radius:14px;padding:12px 14px;display:flex;flex-direction:column;gap:2px}
.rep-fig b{font-family:var(--display);font-size:24px;font-variant-numeric:tabular-nums}
.rep-fig span{font-size:13px;color:var(--ink-2)}
.rep-fig small{font-size:11.5px;color:var(--ink-2)}
.rep-doc-tbl{min-width:0;max-width:640px}
.rep-doc-tbl td{padding:7px 10px}

@media (max-width:900px){
  .gov-row3{grid-template-columns:minmax(0,1fr)}
  .gov-editor{grid-template-columns:minmax(0,1fr)}
  .gov-preview{max-height:360px}
  .gov-cards{grid-template-columns:minmax(0,1fr)}
  .sup-msg{max-width:100%}
  .gov-inline{flex-direction:column;align-items:stretch}
  .rep-doc{padding:18px 16px}
  .adm-actions.nowrap{flex-wrap:wrap}
}
@media print{
  .rep-doc{border:0;padding:0}
  .rep-doc section{break-inside:avoid}
  .rep-fig{border:1px solid #ccc;background:#fff}
  .rep-tbl,.rep-tip{display:none !important}
}
.rep-tip[hidden]{display:none}
.adm-subtabs{width:fit-content}
.rep-fmt .adm-tbl{min-width:0}
.adm-sec-b>p+.kv{margin-top:14px}
/* O tom "ok" dos chips colide com a classe global .ok do app.css (círculo de 60px). */
.chip-s.ok{width:auto;height:auto;display:inline-flex;box-shadow:none;border-radius:999px}
.gov-ropa td:first-child{min-width:210px}.gov-ropa .adm-tbl{min-width:980px}
.gov-fit .adm-tbl{min-width:0}
