/* Painel de reclamações no Bacen (versão HTML) — usa as variáveis de styles.css */
.rc { --rc-c1: var(--link); --rc-c2: var(--heat-3); --rc-c3: var(--heat-5); --rc-c4: var(--heat-1); --rc-c5: var(--muted); --rc-c6: var(--heat-2); }

/* filtros */
.rc-bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 16px 20px; }
.rc-f { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; color: var(--muted); font-weight: 600; }
.rc-f select, .rc-f input { font: inherit; font-size: .95rem; font-weight: 400; color: var(--ink); background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: 7px 10px; min-width: 150px; }
.rc-f-inst { flex: 1 1 260px; }
.rc-f-inst input { width: 100%; }
.rc-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-height: 20px; margin: 12px 0 4px; font-size: .9rem; }
.rc-chips .rc-hint { color: var(--muted); }
.rc-chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ink); color: var(--paper); border: 0; border-radius: 999px; padding: 5px 12px; font: inherit; font-size: .88rem; cursor: pointer; }
.rc-chip:hover { background: var(--link); }
.rc-chip span { opacity: .75; }
.rc-clear { background: transparent; border: 0; color: var(--link); font: inherit; font-size: .88rem; text-decoration: underline; cursor: pointer; padding: 4px; }
.rc-aviso { margin: 8px 0 0; padding: 10px 14px; border-left: 4px solid var(--heat-3); background: var(--surface); border-radius: 4px; font-size: .9rem; color: var(--ink); }

/* abas */
.rc-tabs { display: flex; flex-wrap: wrap; gap: 4px 24px; border-bottom: 1px solid var(--rule); margin: 20px 0 16px; }
.rc-tabs button { font: inherit; font-weight: 600; font-size: 1rem; color: var(--muted); background: none; border: 0; padding: 10px 0; cursor: pointer; box-shadow: inset 0 -2px 0 transparent; }
.rc-tabs button:hover { color: var(--ink); }
.rc-tabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -3px 0 var(--ink); }

/* cartões e grade */
.rc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.rc-grid .rc-wide { grid-column: 1 / -1; }
.rc-card { background: var(--surface); border: 1px solid var(--rule); border-radius: 8px; padding: 20px; min-width: 0; position: relative; }
.rc-card.rc-gap { margin-top: 16px; }
.rc-card h2 { font-size: 1.1rem; margin: 0 0 4px; letter-spacing: -0.01em; }
.rc-sub { color: var(--muted); font-size: .85rem; margin: 0 0 10px; }
.rc-cardhead { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 10px; }
.rc-cardhead .rc-sub { margin: 0; }
.rc-count { color: var(--muted); font-size: .85rem; }

.rc-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 6px; overflow: hidden; }
.rc-seg button { font: inherit; font-size: .85rem; background: var(--paper); color: var(--muted); border: 0; padding: 6px 12px; cursor: pointer; }
.rc-seg button + button { border-left: 1px solid var(--rule); }
.rc-seg button[aria-checked="true"] { background: var(--ink); color: var(--paper); }

/* legendas e gráficos */
.rc-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .8rem; margin: 0 0 8px; }
.rc-sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.rc-sw.c0 { background: var(--rc-c1); } .rc-sw.c1 { background: var(--rc-c2); } .rc-sw.c2 { background: var(--rc-c3); }
.rc-sw.c3 { background: var(--rc-c4); } .rc-sw.c4 { background: var(--rc-c5); } .rc-sw.c5 { background: var(--rc-c6); }
.rc-sw.p0 { background: var(--heat-4); } .rc-sw.p1 { background: var(--heat-2); } .rc-sw.p2 { background: var(--link); }
.rc-sw.p3 { background: var(--heat-1); } .rc-sw.p4 { background: #A9B4B1; }
.rc-sw.rc-bar-c { background: var(--link); } .rc-sw.rc-dot-c { background: var(--heat-4); border-radius: 50%; }

.rc-chart { position: relative; width: 100%; min-height: 120px; }
.rc-chart svg { display: block; overflow: visible; }
.rc-chart text { font-family: var(--font-ui); font-size: 12px; fill: var(--muted); }
.rc-chart .lbl { fill: var(--ink); }
.rc-chart .grid { stroke: var(--rule); }
.rc-chart .hit { fill: transparent; }
.rc-chart .linha { fill: none; stroke: var(--heat-4); stroke-width: 2; }
.rc-chart .ponto { fill: var(--heat-4); }
.rc-chart .sel-q { fill: var(--paper); }
.rc-empty { color: var(--muted); font-size: .9rem; padding: 24px 0; }

.rc-tip { position: absolute; z-index: 10; pointer-events: none; background: var(--surface); border: 1px solid var(--rule); box-shadow: 0 6px 20px rgba(22,38,46,.12); border-radius: 6px; padding: 8px 10px; font-size: .82rem; line-height: 1.45; color: var(--ink); max-width: 380px; white-space: pre-line; }
.rc-tip b { font-weight: 700; }

/* tabelas */
.rc-tablewrap { overflow: auto; max-height: 560px; border-top: 1px solid var(--rule); }
.rc-tablewrap.rc-tall { max-height: 720px; }
.rc-tablewrap.rc-short { max-height: 420px; }
.rc-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.rc-table th { position: sticky; top: 0; z-index: 2; background: var(--surface); text-align: left; font-weight: 700; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: bottom; }
.rc-table td { padding: 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.rc-table .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-table th.n { text-align: right; }
.rc-table .pos { color: var(--muted); width: 1%; white-space: nowrap; }
.rc-table .irr { min-width: 300px; max-width: 520px; line-height: 1.4; }
.rc-table .irr.tem-apl { cursor: help; text-decoration: underline dotted var(--rule); text-underline-offset: 3px; }
.rc-table tr.total td { font-weight: 700; background: var(--paper); }
.rc-table tbody tr.clic { cursor: pointer; }
.rc-table tbody tr.clic:hover td { background: var(--paper); }
.rc-table .bar-cell { min-width: 120px; }
.rc-mini { display: block; height: 6px; border-radius: 3px; background: var(--link); margin-top: 4px; }
.rc-tag { display: inline-block; border: 1px solid var(--rule); border-radius: 999px; padding: 1px 8px; white-space: nowrap; font-size: .76rem; color: var(--muted); }
.rc-auto { color: var(--muted); font-size: .76rem; }
.rc-up { color: var(--heat-5); } .rc-down { color: var(--link); }
.rc-dim { color: var(--muted); }

/* matrizes (primeira coluna fixa, cabeçalhos estreitos) */
.rc-matrix th.inst, .rc-heat th.inst { min-width: 52px; max-width: 72px; white-space: normal; overflow-wrap: anywhere; font-size: .7rem; line-height: 1.2; text-align: center; padding: 8px 3px; }
.rc-heat .irr { min-width: 230px; max-width: 280px; font-size: .8rem; line-height: 1.3; }
.rc-heat th:first-child { min-width: 230px; }
.rc-matrix td.n { text-align: right; }
.rc-matrix th:first-child, .rc-matrix td:first-child, .rc-heat th:first-child, .rc-heat td:first-child { position: sticky; left: 0; z-index: 1; background: var(--surface); }
.rc-matrix th:first-child, .rc-heat th:first-child { z-index: 3; }
.rc-heat td.h { text-align: center; font-variant-numeric: tabular-nums; padding: 0; border-bottom: 2px solid var(--surface); border-right: 2px solid var(--surface); min-width: 44px; height: 30px; vertical-align: middle; }
.rc-heat td.h span { display: block; line-height: 30px; }
.rc-h5 { background: var(--heat-5); color: #fff; }
.rc-h4 { background: var(--heat-4); color: #fff; }
.rc-h3 { background: var(--heat-3); color: var(--ink); }
.rc-h2 { background: var(--heat-2); color: var(--ink); }
.rc-h1 { background: var(--heat-1); color: var(--ink); }
.rc-h0 { background: #E6EBEA; color: var(--muted); }
.rc-heat-leg .rc-sw { width: 14px; height: 14px; }

@media (max-width: 860px) {
  .rc-grid { grid-template-columns: 1fr; }
  .rc-f select { min-width: 120px; }
  .rc-table .irr { min-width: 220px; }
}

/* comparativo (mesmo visual do Power BI: reclamações, índice com seta, % com cor por posição) */
.rc-comp th, .rc-comp td { padding: 6px 8px; }
.rc-comp thead tr:first-child th { top: 0; }
.rc-comp thead tr:nth-child(2) th { top: 31px; font-weight: 600; font-size: .76rem; white-space: nowrap; }
.rc-comp th.grupo { text-align: left; color: var(--ink); font-size: .8rem; border-left: 2px solid var(--rule); white-space: nowrap; }
.rc-comp .ini { border-left: 2px solid var(--rule); }
.rc-comp td.pct { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 72px; border-bottom: 2px solid var(--surface); }
.rc-comp td.pct.escuro { color: #fff; }
.rc-comp .irr { min-width: 280px; max-width: 380px; font-size: .82rem; line-height: 1.35; }
.rc-comp tr.total td { border-top: 2px solid var(--ink); }
.rc-seta { font-size: .72rem; margin-left: 4px; }
.rc-seta.up { color: #C8321E; } .rc-seta.down { color: #1E8A4C; } .rc-seta.eq { color: var(--muted); }
.rc-legend .rc-seta { margin: 0 4px 0 0; }
.rc-sw.rc-g1 { background: #E32000; } .rc-sw.rc-g2 { background: #D2A500; } .rc-sw.rc-g3 { background: #008648; }

/* seleção (filtro cruzado) */
.rc-table tbody tr.sel td { background: #DCE8E5; font-weight: 600; }
.rc-table tbody tr.apagado td { color: #9AA6A9; }
.rc-chart g.clic { cursor: pointer; }
.rc-chart g.apagado rect:not(.hit) { opacity: .3; }
.rc-chart g.apagado text { opacity: .5; }
.rc-chart rect.seg { cursor: pointer; }
.rc-chart rect.seg.apagado { opacity: .25; }
