/* Comercial > Acumulado (comissionamento por colaborador).
   Uma resposta por nivel: lista -> ficha da pessoa -> competencia aberta. O detalhe do
   mes vive em <details>, entao abrir e fechar nao re-renderiza a tela. Tudo escopado em
   #comercialShell, como as demais folhas de layout do Comercial. */
#comercialShell .acc { display: flex; flex-direction: column; gap: 16px; min-width: 0; max-width: 100%; }
#comercialShell .acc.is-refreshing { opacity: .72; }
#comercialShell .acc-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; }
#comercialShell .acc-title { margin: 2px 0 4px; font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; }
#comercialShell .acc-sublead { margin: 0; max-width: 62ch; color: var(--muted); font-size: var(--fs-sm); }
#comercialShell .acc-head__right { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
/* input[type=month] tem largura intrinseca grande: sem min-width 0 ele estoura a tela
   estreita e arrasta a secao inteira junto. */
#comercialShell .acc-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: var(--fs-xs); color: var(--muted); }
#comercialShell .acc-field input { width: 100%; min-width: 0; min-height: 36px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: var(--fs-md); }
#comercialShell .acc-field--busca { min-width: 220px; flex: 1 1 220px; }
#comercialShell .acc-btn { min-height: 36px; padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
#comercialShell .acc-btn:hover { background: var(--surface-muted); }
#comercialShell .acc-btn--primary { border-color: var(--blue); background: var(--blue); color: #fff; }
#comercialShell .acc-btn--primary:hover { background: var(--blue-deep); }
#comercialShell .acc-btn[disabled] { opacity: .6; cursor: progress; }

#comercialShell .acc-answer { padding: 16px 18px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
#comercialShell .acc-answer__lead { margin: 0 0 12px; font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; }
#comercialShell .acc-figures { display: flex; flex-wrap: wrap; gap: 10px; }
#comercialShell .acc-figure { flex: 1 1 160px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); }
#comercialShell .acc-figure span { display: block; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#comercialShell .acc-figure strong { display: block; margin-top: 2px; font-size: var(--fs-xl); font-weight: 800; }
#comercialShell .acc-figure--negativo strong { color: var(--red); }
#comercialShell .acc-figure--positivo strong { color: var(--green); }

#comercialShell .acc-filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
#comercialShell .acc-chips { display: flex; flex-wrap: wrap; gap: 6px; }
#comercialShell .acc-chip-btn { padding: 6px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
#comercialShell .acc-chip-btn.is-active { border-color: var(--blue); background: var(--blue-soft); color: var(--blue-deep); }
#comercialShell .acc-chip { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--surface-muted); color: var(--muted); font-size: var(--fs-xs); font-weight: 600; vertical-align: middle; text-transform: none; }
#comercialShell .acc-chip--amber { background: var(--amber-soft); color: var(--amber-deep); }
#comercialShell .acc-chip--muted { background: var(--red-soft); color: var(--red-deep); }

#comercialShell .acc-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
#comercialShell .acc-table th { padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--surface-muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; color: var(--muted); text-align: left; }
#comercialShell .acc-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); font-size: var(--fs-md); vertical-align: middle; }
#comercialShell .acc-table tbody tr:last-child td { border-bottom: 0; }
#comercialShell .acc-row { cursor: pointer; }
#comercialShell .acc-row:hover td { background: var(--blue-soft); }
#comercialShell .acc-row:focus-visible td { background: var(--blue-soft); }
#comercialShell .acc-row small { display: block; margin-top: 2px; color: var(--muted); font-size: var(--fs-xs); }
#comercialShell .acc-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#comercialShell .acc-num--negativo { color: var(--red); }
#comercialShell .acc-num--positivo { color: var(--green); }
#comercialShell .acc-go { width: 24px; color: var(--muted); text-align: right; font-size: var(--fs-lg); }

#comercialShell .acc-ficha { display: flex; flex-direction: column; gap: 12px; }
#comercialShell .acc-back { align-self: flex-start; padding: 4px 0; border: 0; background: none; color: var(--blue); font-size: var(--fs-sm); font-weight: 600; cursor: pointer; }
#comercialShell .acc-ficha__head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
#comercialShell .acc-ficha__head h2 { margin: 0; font-size: var(--fs-xl); font-weight: 800; }
#comercialShell .acc-ficha__sub { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
#comercialShell .acc-sub { margin: 10px 0 0; font-size: var(--fs-md); font-weight: 700; }
#comercialShell .acc-sub small { margin-left: 8px; color: var(--muted); font-size: var(--fs-xs); font-weight: 500; }

#comercialShell .acc-mes { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
#comercialShell .acc-mes + .acc-mes { margin-top: 8px; }
#comercialShell .acc-mes > summary { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 12px 14px; cursor: pointer; list-style: none; }
#comercialShell .acc-mes > summary::-webkit-details-marker { display: none; }
#comercialShell .acc-mes > summary::after { content: "+"; order: 3; color: var(--muted); font-weight: 700; }
#comercialShell .acc-mes[open] > summary::after { content: "–"; }
#comercialShell .acc-mes[open] > summary { border-bottom: 1px solid var(--border); }
#comercialShell .acc-mes__nome { font-weight: 700; }
#comercialShell .acc-mes__valores { display: flex; flex-wrap: wrap; gap: 12px; align-items: baseline; margin-left: auto; font-variant-numeric: tabular-nums; }
#comercialShell .acc-mes__valores small { color: var(--muted); font-size: var(--fs-xs); }
#comercialShell .acc-mes__valores strong { font-size: var(--fs-md); font-weight: 800; }
#comercialShell .acc-mes__corpo { display: flex; flex-direction: column; gap: 10px; padding: 14px; }
#comercialShell .acc-mes__corpo h4 { margin: 4px 0 0; font-size: var(--fs-sm); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }

#comercialShell .acc-dl { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
#comercialShell .acc-dl > div { flex: 1 1 150px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-muted); }
#comercialShell .acc-dl dt { font-size: var(--fs-xs); color: var(--muted); }
#comercialShell .acc-dl dd { margin: 2px 0 0; font-size: var(--fs-md); font-weight: 700; font-variant-numeric: tabular-nums; }

#comercialShell .acc-note { margin: 0; padding: 10px 12px; border-left: 3px solid var(--border); border-radius: 0 8px 8px 0; background: var(--surface-muted); font-size: var(--fs-sm); line-height: 1.5; }
#comercialShell .acc-note--negativo { border-left-color: var(--red); background: var(--red-soft); }
#comercialShell .acc-note--positivo { border-left-color: var(--green); background: var(--green-soft); }
#comercialShell .acc-note--amber { border-left-color: var(--amber-deep); background: var(--amber-soft); }
#comercialShell .acc-note--muted { color: var(--muted); }

#comercialShell .acc-ciclo { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
#comercialShell .acc-ciclo li { flex: 1 1 120px; padding: 8px 10px; border: 1px dashed var(--border); border-radius: 8px; }
#comercialShell .acc-ciclo span { display: block; font-size: var(--fs-xs); color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
#comercialShell .acc-ciclo strong { font-size: var(--fs-sm); }

#comercialShell .acc-avisos { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-muted); font-size: var(--fs-sm); }
#comercialShell .acc-avisos summary { cursor: pointer; font-weight: 600; }
#comercialShell .acc-avisos ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
#comercialShell .acc-empty { padding: 20px; border: 1px dashed var(--border); border-radius: 10px; color: var(--muted); text-align: center; }
#comercialShell .acc-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  #comercialShell .acc-head { flex-direction: column; align-items: stretch; }
  #comercialShell .acc-ficha__head { flex-direction: column; align-items: stretch; }
  #comercialShell .acc-head__right { width: 100%; }
  #comercialShell .acc-field { flex: 1 1 130px; }
  #comercialShell .acc-head__right .acc-btn { flex: 1 1 100%; }
  #comercialShell .acc-figure { flex: 1 1 100%; }
  /* Em tela estreita a tabela vira cartões empilhados. Uma tabela com rolagem própria
     ainda alarga o layout viewport do celular (a largura mínima dela entra no cálculo),
     e a página inteira passa a rolar na horizontal. */
  #comercialShell .acc-table { display: block; width: 100%; border-radius: 10px; }
  #comercialShell .acc-table thead { display: none; }
  #comercialShell .acc-table tbody { display: block; width: 100%; }
  #comercialShell .acc-table tr { display: block; width: 100%; padding: 10px 12px; }
  #comercialShell .acc-table td { display: block; width: 100%; padding: 2px 0; border: 0; text-align: left; white-space: normal; }
  #comercialShell .acc-table td.acc-num::before { content: attr(data-rotulo) ": "; color: var(--muted); font-size: var(--fs-xs); }
  #comercialShell .acc-table .acc-go { display: none; }
  #comercialShell .acc-mes__valores { margin-left: 0; width: 100%; }
}
