/* Consórcios — cores e raios de ui.css: a mesma interface nos temas claro e escuro. */
.co-page { container: co-page / inline-size; display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; min-width: 0; font-variant-numeric: tabular-nums; }
.co-page > * { min-width: 0; max-width: 100%; }
.co-page .panel { margin: 0; padding: 16px; }
.co-page h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 18px; margin: 0 0 8px; }
.co-page p { line-height: 1.6; overflow-wrap: anywhere; }
.co-page small { display: block; font-size: 12px; font-weight: 400; line-height: 1.6; white-space: normal; color: var(--muted); }

/* Filtros do servidor */
.co-controls { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin-bottom: 20px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); font-variant-numeric: tabular-nums; }
.co-controls label,.co-table-tools label { display: grid; gap: 8px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
#content :is(.co-controls,.co-table-tools) :is(input,select) { box-sizing: border-box; width: 100%; min-height: 44px; height: 44px; min-width: 0; font-size: 16px; }

/* Indicadores (KPIs) no topo: rótulo, valor, legenda */
.co-overview { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.co-kpi { display: grid; align-content: start; gap: 4px; min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); box-shadow: inset 0 4px 0 var(--accent), var(--sh-1); }
.co-kpi:last-child:nth-child(odd) { grid-column: 1 / -1; }
.co-kpi-label { display: flex; align-items: center; gap: 2px; min-height: 44px; margin: 0; font-size: 13px; font-weight: 600; color: var(--ink-2); overflow-wrap: anywhere; }
.co-page .co-kpi { container-type: inline-size; }
.co-page .co-kpi-value { margin: 0; font-size: clamp(18px,1.8vw,26px); font-size: clamp(18px,13cqi,30px); font-weight: 700; line-height: 1.15; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
.co-kpi-sep { font-weight: 400; color: var(--muted); }
.co-page .co-kpi-note { margin: 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.co-kpi--warn { border-color: var(--warn); background: var(--warn-soft); box-shadow: inset 0 4px 0 var(--warn), var(--sh-1); }
.co-page .co-kpi--warn :is(.co-kpi-value,.co-kpi-label,.co-kpi-note) { color: var(--warn); }

/* Faixa de divergências */
.co-alert { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border: 1px solid var(--warn); border-left-width: 6px; border-radius: var(--r-md); background: var(--warn-soft); color: var(--ink); }
.co-alert p { flex: 1 1 260px; margin: 0; }
.co-alert-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-pill); background: var(--warn); color: var(--surface); font-weight: 800; }
.co-link { min-height: 44px; padding: 8px 4px; border: 0; background: none; color: var(--accent-ink); font: inherit; font-weight: 600; text-align: left; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; overflow-wrap: anywhere; }
.co-link:hover { text-decoration-thickness: 2px; }

/* Agrupamentos por administradora e titular */
.co-groups { display: grid; grid-template-columns: minmax(0,1fr); gap: 20px; }
.co-group { min-width: 0; }
.co-meter { display: block; height: 6px; margin-top: 4px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.co-meter span { display: block; height: 100%; background: var(--green); }
.co-total-row > :is(th,td) { font-weight: 700; }
.co-scroll tbody tr.co-total-row > :is(th,td) { background: var(--surface-2); }

/* Tabelas */
.co-page dl { margin: 12px 0; }
.co-page dt { font-weight: 600; margin-top: 12px; color: var(--ink-2); }
.co-page dd { margin: 4px 0; overflow-wrap: anywhere; }
.co-scroll { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.co-scroll table { min-width: 600px; width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.co-scroll th,.co-scroll td { white-space: normal; text-align: left; vertical-align: top; min-width: 120px; max-width: 300px; padding: 12px; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); color: var(--ink); }
.co-scroll thead th { background: var(--surface-2); color: var(--ink-2); font-size: 12px; }
.co-scroll tbody tr > :is(th,td) { background: var(--surface); }
.co-scroll tbody tr:hover > :is(th,td) { background: var(--surface-2); }
.co-scroll caption { text-align: left; padding: 12px; color: var(--muted); font-size: 12px; }
.co-scroll .co-num { text-align: right; }
.co-scroll td.co-num { white-space: nowrap; }
.co-scroll td.co-num small { white-space: normal; }
.co-compact { min-width: 0; }
.co-scroll table.co-compact { min-width: 440px; }
.co-compact :is(th,td) { min-width: 0; padding: 8px 12px; vertical-align: middle; }
.co-compact th[scope="row"] { min-width: 140px; }
.co-compact thead th { white-space: nowrap; }

/* Contratos: ordenação, alertas e situação */
.co-table-tools { display: grid; grid-template-columns: minmax(0,1fr); gap: 12px; margin: 12px 0 0; }
.co-page .co-count { margin: 12px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.co-contracts-scroll { max-height: 40rem; overflow: auto; margin-top: 8px; }
.co-contracts-scroll table { min-width: 980px; }
.co-contracts-scroll thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); padding: 0; }
.co-contracts-scroll tbody th[scope="row"] { position: sticky; left: 0; z-index: 1; min-width: 150px; border-right: 1px solid var(--line-strong); }
.co-contracts-scroll thead th:first-child { left: 0; z-index: 3; }
.co-contracts-scroll details dl { min-width: 160px; }
.co-sort { display: flex; align-items: center; gap: 6px; width: 100%; min-height: 44px; padding: 8px 12px; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; text-align: left; cursor: pointer; }
.co-num .co-sort { justify-content: flex-end; text-align: right; }
.co-sort:hover { color: var(--accent-ink); }
th[aria-sort="ascending"] .co-sort,th[aria-sort="descending"] .co-sort { color: var(--accent-ink); }
.co-sort-icon { font-size: 11px; }
.co-row--alert > th[scope="row"] { box-shadow: inset 4px 0 0 var(--warn); }
.co-cell--div > div { display: grid; gap: 4px; justify-items: end; }
.co-flag { display: inline-block; padding: 1px 6px; border: 1px solid var(--warn); border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); font-size: 11px; font-weight: 700; line-height: 1.5; white-space: nowrap; }
.co-badge { display: block; padding: 5px 8px; margin: 0 0 8px; border: 1px solid var(--warn); border-radius: var(--r-sm); color: var(--warn); background: var(--warn-soft); font-size: 12px; font-weight: 600; }
.co-ok { display: block; margin-bottom: 8px; font-size: 12px; color: var(--muted); }
.co-chip { display: inline-block; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface-3); color: var(--ink-2); font-size: 12px; font-weight: 600; white-space: nowrap; }
.co-chip--yes { border-color: var(--ok); background: var(--ok-soft); color: var(--ok); }
.co-chip--new { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.co-chip--div { border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.co-chip--quit { border-color: var(--ok); background: var(--surface); color: var(--ok); }
.co-chip--none { border-style: dashed; background: var(--surface); color: var(--muted); }

/* Fluxo */
.co-flow-scroll { overflow-x: auto; isolation: isolate; }
.co-flow-scroll table { min-width: 1050px; }
.co-flow-scroll tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 160px; max-width: 240px; background: var(--surface); border-right: 1px solid var(--line-strong); }
.co-flow-scroll thead tr > :first-child { background: var(--surface-2); }
.co-chart { display: grid; gap: 16px; margin: 16px 0; }
.co-bar-row { display: grid; grid-template-columns: 120px minmax(20px,1fr) minmax(170px,auto); gap: 14px; align-items: center; }
.co-bar-row > span { text-align: right; }
.co-track { background: var(--surface-3); height: 16px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line-strong); }
.co-track span { display: block; height: 100%; background: var(--green); }

/* Leituras e detalhes */
.co-page summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 600; overflow-wrap: anywhere; }
.co-page summary::before { content: "+"; color: var(--accent-ink); flex: 0 0 auto; }
.co-page details[open] > summary::before { content: "−"; }
.co-page details[open] > summary { margin-bottom: 8px; }
.co-reading { margin: 8px 0; }
.co-page :focus-visible,.co-controls :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.co-contracts-scroll .co-sort:focus-visible { outline-offset: -3px; }
@media (pointer: coarse) { .co-page .ne-tip-btn { min-height: 44px; min-width: 44px; } .co-page .ne-tip-btn::before { content: none; } }   /* 29/10: no mouse o (i) volta ao tamanho padrão das outras telas */

/* Estados */
.co-state { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); color: var(--ink); }
.co-state button { min-height: 44px; min-width: 44px; padding: 8px 16px; border: 1px solid var(--accent); border-radius: var(--r-sm); background: var(--accent); color: var(--on-accent); font-weight: 600; cursor: pointer; }
.co-state button:hover { background: var(--accent-ink); }
.co-state :focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.co-state[role="alert"] { border-color: var(--danger); border-left-width: 6px; background: var(--danger-soft); }
.co-skeleton { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,140px),1fr)); gap: 12px; margin-top: 12px; }
.co-skeleton span { height: 84px; border-radius: var(--r-md); background: linear-gradient(90deg,var(--surface-2),var(--surface-3),var(--surface-2)); background-size: 200% 100%; animation: co-pulse 1.4s ease-in-out infinite; }
@keyframes co-pulse { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .co-skeleton span { animation: none; } }

@media (min-width:768px) {
  .co-controls { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .co-table-tools { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
}
@media (min-width:1024px) {
  .co-controls { grid-template-columns: repeat(4,minmax(0,1fr)); }
}
/* KPIs e agrupamentos seguem a largura útil (menu lateral incluído), não a da janela. */
@container co-page (min-width: 560px) {
  .co-overview { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .co-kpi:last-child:nth-child(odd) { grid-column: auto; }
}
@container co-page (min-width: 940px) {
  .co-overview { grid-template-columns: repeat(5,minmax(0,1fr)); }
  .co-groups { grid-template-columns: repeat(2,minmax(0,1fr)); align-items: start; }
}
@media (max-width:767.98px) {
  .co-contracts-scroll { max-height: none; overflow: visible; border: 0; background: none; }
  .co-contracts-scroll table,.co-contracts-scroll tbody { display: block; min-width: 0; width: 100%; }
  .co-contracts-scroll thead { display: block; }
  .co-contracts-scroll thead tr { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
  .co-contracts-scroll thead th { position: static; display: block; min-width: 0; max-width: none; padding: 0; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); }
  .co-contracts-scroll thead .co-sort { min-height: 44px; padding: 6px 12px; font-size: 12px; }
  .co-contracts-scroll caption { display: block; padding: 8px 0; }
  .co-contracts-scroll tbody tr { display: grid; grid-template-columns: minmax(0,1fr); margin-bottom: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
  .co-contracts-scroll tbody tr.co-row--alert { border-left: 6px solid var(--warn); }
  .co-contracts-scroll tbody tr > th[scope="row"] { position: static; border: 0; box-shadow: none; }
  .co-contracts-scroll tbody :is(th,td) { position: static; display: block; min-width: 0; max-width: none; padding: 8px 0; border: 0; box-shadow: none; }
  .co-contracts-scroll td[data-label] { display: grid; grid-template-columns: minmax(0,2fr) minmax(0,3fr); gap: 12px; border-top: 1px solid var(--line); text-align: left; white-space: normal; }
  .co-contracts-scroll td[data-label]::before { content: attr(data-label); font-size: 12px; font-weight: 600; color: var(--muted); }
  .co-contracts-scroll td > div { min-width: 0; }
  .co-contracts-scroll .co-cell--div > div { justify-items: start; }
  .co-contracts-scroll details dl { min-width: 0; }
  .co-bar-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 8px; }
  .co-track { grid-column: 1 / -1; grid-row: 2; }
  .co-bar-row > span { overflow-wrap: anywhere; }
}

/* Endividamento consolidado e empréstimos (23/10) */
.co-debt-total { margin-bottom: 12px; }
.co-src-statement { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--ok-soft); color: var(--ok); font-size: 11.5px; font-weight: 600; }
.co-src-check { display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.co-sheet-note { display: block; margin-top: 2px; color: var(--muted); font-size: 11.5px; }
.co-loans th small { display: block; color: var(--muted); font-weight: 400; }
.co-loans .co-badge-warn { display: inline-block; margin: 2px 0; }
.co-row-warn th { border-left: 3px solid var(--warn); }
.co-loan-months { list-style: none; margin: 12px 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px; }
.co-loan-months li { padding: 6px 8px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); text-align: center; }
.co-loan-months span { display: block; font-size: 11.5px; color: var(--muted); }
.co-loan-months strong { font-variant-numeric: tabular-nums; font-size: 13px; }

/* Base mensal: rolagem contida, identidade fixa e avisos do extrato. */
.co-base { min-width: 0; margin-bottom: 24px; }
.co-base-scroll .co-base-source { display: block; color: var(--muted); font-size: 12px; font-weight: 400; white-space: normal; }
.co-base-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; }
.co-base-heading h2 { margin: 0; font-size: 18px; }
.co-base > p { font-size: 13px; color: var(--muted); }
.co-base-scroll { max-height: 70vh; overflow: auto; isolation: isolate; font-variant-numeric: tabular-nums; }
.co-base-scroll table { width: max-content; min-width: 0; table-layout: fixed; font-size: 13px; }
.co-base-scroll :is(th,td) { box-sizing: border-box; min-width: 128px; width: 128px; max-width: 128px; padding: 4px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.co-base-scroll tr > :first-child { position: sticky; left: 0; z-index: 1; min-width: 160px; width: 160px; max-width: 160px; background: var(--surface); }
.co-base-scroll tr > :nth-child(2) { position: sticky; left: 160px; z-index: 1; background: var(--surface); }
.co-base-scroll tr > :nth-child(3) { position: sticky; left: 240px; z-index: 1; background: var(--surface); }
.co-base-scroll tr > :is(:nth-child(2),:nth-child(3)) { min-width: 80px; width: 80px; }
.co-base-scroll thead th { position: sticky; top: 0; z-index: 2; }
.co-base-scroll tfoot :is(th,td) { position: sticky; bottom: 0; z-index: 2; font-weight: 700; }
.co-base-scroll :is(thead,tfoot) tr > :is(th,td) { background: var(--surface-2); }
.co-base-scroll :is(thead,tfoot) tr > :nth-child(-n+3) { z-index: 3; }
.co-base-scroll thead tr > :nth-child(-n+3) { z-index: 4; }
.co-base-scroll tbody tr:nth-child(even) > :is(th,td) { background: var(--surface-2); }
.co-base-scroll tbody tr.co-base-row-warning > :is(th,td) { background: var(--warn-soft); color: var(--warn); }
.co-base-scroll :is(thead th,.co-num) { white-space: nowrap; }
.co-base-scroll .co-base-warning { color: var(--warn); display: block; font-size: 12px; font-weight: 400; white-space: normal; }
.co-base-download { display: inline-flex; align-items: center; box-sizing: border-box; min-height: 44px; margin-left: auto; }
@media (max-width:767.98px) {
  .co-base { padding: 12px; }
  .co-base-scroll :is(th,td) { min-width: 120px; width: 120px; max-width: 120px; padding: 4px 6px; }
  .co-base-scroll tr > :first-child { min-width: 104px; width: 104px; max-width: 104px; }
  .co-base-scroll tr > :is(:nth-child(2),:nth-child(3)) { min-width: 60px; width: 60px; max-width: 60px; }
  .co-base-scroll tr > :nth-child(2) { left: 104px; }
  .co-base-scroll tr > :nth-child(3) { left: 164px; }
  .co-base-scroll thead th { font-size: 11px; }
}

/* 04/11 (Rany): sininho de informação faltando, botão Importar extrato e cota quitada na base. */
.co-base-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.co-base-tools .co-base-download { margin-left: 0; }
.co-base-import-btn { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; min-height: 44px; }
.co-base-alerts-slot:empty { display: none; }
.co-base-alerts { position: relative; }
.co-base-alerts > summary { list-style: none; display: inline-flex; align-items: center; gap: 4px; box-sizing: border-box; min-width: 44px; min-height: 44px; padding: 0 10px; border: 1px solid var(--warn); border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); cursor: pointer; font-weight: 700; }
.co-base-alerts > summary::-webkit-details-marker { display: none; }
.co-base-alerts > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.co-base-badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; box-sizing: border-box; border-radius: var(--r-pill); background: var(--warn); color: var(--surface); font-size: 12px; line-height: 1; }
.co-base-alerts-box { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; width: min(360px, calc(100vw - 32px)); max-height: 60vh; overflow: auto; box-sizing: border-box; padding: 12px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); color: var(--ink); box-shadow: var(--sh-2); font-size: 13px; }
.co-base-alerts-box p { margin: 0 0 8px; }
.co-base-alerts-box ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.co-base-alerts-box li { display: grid; gap: 2px; padding: 6px 8px; border-left: 3px solid var(--warn); border-radius: var(--r-sm); background: var(--surface-2); overflow-wrap: anywhere; }
.co-base-alerts-box li span { color: var(--warn); font-size: 12px; }
.co-base-import:not([hidden]) { margin: 12px 0; }
.co-imp-box { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); font-size: 13px; min-width: 0; }
.co-imp-box p { margin: 0; }
.co-imp-note { color: var(--muted); }
.co-imp-pick { display: grid; gap: 4px; font-weight: 600; }
.co-imp-pick input { width: 100%; max-width: 100%; box-sizing: border-box; min-height: 44px; font-size: 14px; }
.co-imp-picked { overflow-wrap: anywhere; }
.co-imp-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.co-imp-actions button { min-height: 44px; }
.co-imp-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.co-imp-list li { display: grid; gap: 2px; padding: 6px 8px; border-left: 3px solid var(--line-strong); border-radius: var(--r-sm); background: var(--surface); overflow-wrap: anywhere; }
.co-imp-list li span { color: var(--muted); font-size: 12px; }
.co-imp-list li.co-imp-ok { border-left-color: var(--ok); }
.co-imp-list li.co-imp-ok > span:first-of-type { color: var(--ok); font-weight: 600; }
.co-imp-list li.co-imp-bad { border-left-color: var(--warn); }
.co-imp-list li.co-imp-bad > span:first-of-type { color: var(--warn); font-weight: 600; }
.co-base-scroll tbody th small.co-base-quit { display: block; width: fit-content; margin-top: 2px; padding: 0 8px; border: 1px solid var(--ok); border-radius: var(--r-pill); color: var(--ok); font-size: 11px; font-weight: 600; }
.co-base-scroll tbody tr.co-base-row-settled > td:last-child { color: var(--ok); font-weight: 600; }
@media (max-width:767.98px) {
  .co-base-tools { width: 100%; margin-left: 0; }
  .co-base-tools > * { flex: 1 1 140px; justify-content: center; }
  .co-imp-actions button { flex: 1 1 120px; }
  /* No celular a lista abre dentro do card (sem sair da tela). */
  .co-base-alerts-slot:has(.co-base-alerts[open]) { flex-basis: 100%; }
  .co-base-alerts-box { position: static; width: auto; margin-top: 6px; box-shadow: none; }
}

/* Base: valores completos e identidade legível ao rolar em telas estreitas. */
.co-base-scroll tbody tr > :nth-child(-n+3) { white-space: normal; overflow-wrap: anywhere; }
.co-base-scroll tbody th small { color: var(--muted); font-weight: 400; line-height: 1.4; letter-spacing: normal; }
.co-base-scroll tbody tr.co-base-row-warning th small { color: var(--warn); }
.co-base-scroll tr > :last-child { min-width: 160px; width: 160px; max-width: 160px; }
@media (max-width:767.98px) {
  .co-base-scroll :is(th,td) { min-width: 128px; width: 128px; max-width: 128px; }
  /* Grupo e cota acompanham os meses; fixar os três impediria a leitura de um valor completo. */
  .co-base-scroll tr > :is(:nth-child(2),:nth-child(3)) { left: auto; }
  .co-base-scroll tbody tr > :is(:nth-child(2),:nth-child(3)) { position: relative; z-index: 0; }
  .co-base-scroll tfoot tr > :first-child { z-index: 4; }
  .co-base-scroll tfoot tr > :is(:nth-child(2),:nth-child(3)) { z-index: 2; }
  .co-base-scroll tr > :last-child { min-width: 160px; width: 160px; max-width: 160px; }
}
/* 29/10 (UX): o (i) das fontes fica ao lado do título; nomes das cotas (linhas) sem caixa-alta forçada,
   para não se confundirem com os cabeçalhos das colunas. */
#co-base-sources { display: inline-flex; align-items: center; }
#co-base-sources:empty { display: none; }
.co-base-scroll tbody th { text-transform: none; letter-spacing: normal; }
@media (min-width: 768px) { .co-base-scroll tbody th { font-size: 13px; } }

/* 04/11 (Rany): fluxo de parcelas compacto (resumo + um bloco por ano) e Dívida por contrato mais enxuta. */
.co-flow-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 14px 0 12px; }
.co-flow-stat { display: grid; gap: 2px; min-width: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.co-flow-stat dt { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.co-flow-stat dd { margin: 0; font: 700 18px/1.2 var(--font-display); font-variant-numeric: tabular-nums; color: var(--ink); overflow-wrap: anywhere; }
.co-flow-stat small { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.co-years { display: grid; gap: 0; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.co-year + .co-year { border-top: 1px solid var(--line); }
.co-year > summary { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; cursor: pointer; }
.co-year-row { display: grid; flex: 1 1 auto; min-width: 0; grid-template-columns: 56px minmax(40px, 1fr) 150px 210px; gap: 4px 14px; align-items: center; }
.co-year > summary:hover { background: var(--surface-2); }
.co-year > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.co-year-label { font: 700 15px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.co-year-track { height: 10px; }
.co-year-total { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.co-year-note { font-size: 12px; color: var(--muted); text-align: right; }
.co-year .co-chart { gap: 6px; margin: 0; padding: 6px 12px 12px 40px; background: var(--surface); }
.co-year .co-bar-row { grid-template-columns: 110px minmax(20px, 1fr) minmax(170px, auto); gap: 10px; font-size: 13px; }
.co-year .co-bar-row > strong { white-space: nowrap; }
.co-year .co-bar-row .co-track { height: 8px; }
.co-year .co-bar-row small { display: block; font-size: 11.5px; color: var(--muted); }
@media (max-width: 1023.98px) { .co-flow-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767.98px) {
  .co-flow-stat dd { font-size: 16px; }
  .co-year-row { grid-template-columns: auto minmax(0, 1fr); }
  .co-year-track { grid-column: 1 / -1; grid-row: 2; }
  .co-year-note { grid-column: 1 / -1; text-align: left; }
  .co-year .co-chart { padding: 4px 12px 12px; }
  .co-year .co-bar-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; }
  .co-year .co-bar-row .co-track { grid-column: 1 / -1; grid-row: 2; }
  .co-year .co-bar-row > span { text-align: right; }
}

#co-contracts .co-contracts-sum { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; padding: 0; list-style: none; }
#co-contracts .co-contracts-sum li { padding: 3px 10px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface-2); font-size: 12.5px; color: var(--ink-2); }
#co-contracts .co-contracts-sum strong { font-variant-numeric: tabular-nums; color: var(--ink); }
#co-contracts .co-contracts-scroll tbody :is(th,td) { padding-top: 8px; padding-bottom: 8px; }
#co-contracts .co-contracts-scroll tbody th[scope="row"] small { text-transform: none; letter-spacing: 0; font-size: 11.5px; }
#co-contracts .co-holder-src { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; font-size: 12px; color: var(--muted); }
#co-contracts .co-holder-src:hover, #co-contracts .co-holder-src:focus-within { -webkit-line-clamp: unset; }
@media (min-width: 768px) {
  #co-contracts .co-table-tools { grid-template-columns: minmax(0, 2fr) minmax(200px, 1fr); }
}
@media (max-width: 767.98px) {
  #co-contracts .co-contracts-scroll thead tr { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  #co-contracts .co-contracts-scroll thead th { flex: 0 0 auto; }
  #co-contracts .co-contracts-scroll tbody tr { gap: 0; padding: 10px 12px; }
  #co-contracts .co-contracts-scroll td[data-label] { grid-template-columns: minmax(84px, 1fr) minmax(0, 2fr); gap: 8px; padding: 6px 0; }
  #co-contracts .co-contracts-scroll td.co-num > div { justify-items: start; text-align: left; }
  #co-contracts .co-contracts-scroll caption { box-sizing: border-box; width: 100%; max-width: 100%; white-space: normal; overflow-wrap: anywhere; text-align: left; }
}

/* 13/11 (responsivo): KPI sem sobreposição — a trilha do cartão não cresce com o valor; a pílula "faltam N" + (i) desce para a linha de baixo quando não cabe */
.co-kpi { grid-template-columns: minmax(0,1fr); }
.co-page .co-kpi-value { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; row-gap: 2px; min-width: 0; }
.co-page .co-kpi-value > .ne-missing { font-size: 13px; white-space: nowrap; }
.co-page .co-kpi-note .ne-missing { font-size: 11px; }
/* Tabelas compactas: texto de apoio em linha própria, menor e sem caixa-alta; larguras mínimas; rolagem própria com sombra nas bordas */
.co-scroll th[scope="row"] small { display: block; margin-top: 2px; font-size: 11.5px; font-weight: 400; line-height: 1.4; letter-spacing: 0; text-transform: none; color: var(--muted); overflow-wrap: normal; word-break: normal; }
.co-compact th[scope="row"] { min-width: 210px; overflow-wrap: normal; }
.co-compact td.co-num { min-width: 132px; }
.co-scroll table.co-compact { min-width: 560px; }
.co-scroll {
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left center / 40px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right center / 40px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) left center / 14px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, color-mix(in srgb, var(--ink) 22%, transparent), transparent) right center / 14px 100% no-repeat scroll,
    var(--surface);
}
.co-scroll tbody tr > :is(th,td) { background: transparent; }
.co-scroll thead th, .co-scroll tbody tr.co-total-row > :is(th,td) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.co-scroll tbody tr:hover > :is(th,td) { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
/* Linha do ano no fluxo: o total cresce com a pílula "faltam N" + (i) em vez de invadir a nota ao lado */
@media (min-width: 768px) { .co-year-row { grid-template-columns: 56px minmax(40px, 1fr) minmax(150px, max-content) minmax(0, 210px); } }
