/* Novo visual: ajustes de leitura testados no protótipo em 360, 390, 768 e 1366 px.
   Só valem com um tema do novo visual ativo (CLT e telas sem tema ficam como estão). */

/* Valores: "R$" nunca se separa do número; o tamanho diminui um pouco quando o cartão é estreito. */
body[data-mj-system-theme] .metric{min-width:0}
body[data-mj-system-theme] .metric b{white-space:nowrap;font-variant-numeric:tabular-nums;font-size:clamp(18px,1.1vw + 10px,24px)}
body[data-mj-system-theme] .grid4{grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr))}

/* Cabeçalho no celular: título e saudação ocupam a linha inteira; ações (sino, status) vão para baixo. */
@media(max-width:720px){
  body[data-mj-system-theme] .topbar{flex-wrap:wrap;gap:10px}
  /* Altura do próprio texto: com o topo empilhado (cobrador), "flex:1 1 100%" virava um vão em branco no Safari do iPhone. */
  body[data-mj-system-theme] .topbar .title{flex:0 0 auto;width:100%;min-width:0}
  body[data-mj-system-theme] .topbar .title p{overflow-wrap:anywhere}
  body[data-mj-system-theme] .topbar .actions{flex-wrap:wrap;width:100%}
}

/* Conferência do caixa: modal largo no computador, tela cheia no celular, textos longos quebram. */
body[data-mj-system-theme] #modal .modalbox:has(#automaticReviewResult){width:min(1080px,96vw)}
body[data-mj-system-theme] #automaticReviewResult td:nth-child(2){white-space:nowrap;font-variant-numeric:tabular-nums}
body[data-mj-system-theme] #automaticReviewResult .notice{line-height:1.45}
@media(max-width:720px){
  body[data-mj-system-theme] #modal:has(#automaticReviewResult){padding:0}
  body[data-mj-system-theme] #modal .modalbox:has(#automaticReviewResult){width:100%;height:100%;max-height:100%;border-radius:0}
  /* Tabelas viram cartões: nome e valor em cima, evidência e ações embaixo, sem rolar para o lado. */
  body[data-mj-system-theme] #automaticReviewResult table,
  body[data-mj-system-theme] #automaticReviewResult tbody,
  body[data-mj-system-theme] #automaticReviewResult tr,
  body[data-mj-system-theme] #automaticReviewResult td{display:block;width:auto!important;min-width:0!important}
  body[data-mj-system-theme] #automaticReviewResult thead{display:none}
  body[data-mj-system-theme] #automaticReviewResult tr{border:1px solid var(--line);border-radius:12px;padding:10px 12px;margin:8px 0;background:var(--panel2)}
  body[data-mj-system-theme] #automaticReviewResult td{border:0;padding:4px 0}
  body[data-mj-system-theme] #automaticReviewResult .grid2,
  body[data-mj-system-theme] #automaticReviewResult .grid3{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* Caixa: no celular as movimentações viram cartões (data e valor em cima; tipo, descrição, cliente e ação embaixo), sem arrastar para o lado. */
@media(max-width:720px){
  body[data-mj-system-theme] table:has(#realCashMovementsBody){display:block;width:100%;min-width:0!important}
  body[data-mj-system-theme] table:has(#realCashMovementsBody) thead{display:none}
  body[data-mj-system-theme] #realCashMovementsBody{display:flex;flex-direction:column;gap:10px}
  body[data-mj-system-theme] #realCashMovementsBody tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
  body[data-mj-system-theme] #realCashMovementsBody td{display:block;padding:0;border:0;min-width:0;overflow-wrap:anywhere}
  body[data-mj-system-theme] #realCashMovementsBody td:nth-child(1){grid-column:1;grid-row:1;color:var(--muted);font-size:13px}
  body[data-mj-system-theme] #realCashMovementsBody td:nth-child(2){grid-column:1;grid-row:2;font-weight:700;text-transform:capitalize}
  body[data-mj-system-theme] #realCashMovementsBody td:nth-child(5){grid-column:2;grid-row:1 / span 2;align-self:start;text-align:right;font-size:16px;font-weight:800;white-space:nowrap;font-variant-numeric:tabular-nums}
  body[data-mj-system-theme] #realCashMovementsBody td:nth-child(3),
  body[data-mj-system-theme] #realCashMovementsBody td:nth-child(4),
  body[data-mj-system-theme] #realCashMovementsBody td:nth-child(6),
  body[data-mj-system-theme] #realCashMovementsBody td[colspan]{grid-column:1 / -1}
  body[data-mj-system-theme] #realCashMovementsBody td:nth-child(4){color:var(--muted);font-size:13px}
  body[data-mj-system-theme] #realCashMovementsBody td:empty{display:none}
}

/* Clientes do cobrador: no celular cada cliente vira um cartão (nome e situação em cima; parcela, pagas e saldo; próxima cobrança; ações). */
@media(max-width:720px){
  body.mj-role-cobrador[data-mj-system-theme] table:has(#realCollectorClientsList){display:block;width:100%;min-width:0!important}
  body.mj-role-cobrador[data-mj-system-theme] table:has(#realCollectorClientsList) thead{display:none}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList{display:flex;flex-direction:column;gap:10px}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList tr{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1fr) minmax(0,1.3fr);gap:8px;padding:14px;border:1px solid var(--line);border-radius:16px;background:var(--panel)}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td{display:block;padding:0;border:0;min-width:0;overflow-wrap:anywhere}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(1){grid-column:1 / 3;grid-row:1}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(1) .link-btn{font-size:16px;font-weight:800;text-align:left;line-height:1.35;color:var(--text)!important}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(6){grid-column:3;grid-row:1;justify-self:end;align-self:start}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:is(:nth-child(2),:nth-child(3),:nth-child(4)){grid-row:2;padding:8px;border-radius:10px;background:var(--bg);font-size:13px;font-weight:700;white-space:nowrap;font-variant-numeric:tabular-nums}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:is(:nth-child(2),:nth-child(3),:nth-child(4))::before{display:block;margin-bottom:2px;font-size:11px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(2)::before{content:"Parcela"}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(3)::before{content:"Pagas"}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(4)::before{content:"Saldo"}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(3) small{color:var(--info)!important;font-size:11px;white-space:normal}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(5){grid-column:1 / -1;font-size:14px;color:var(--muted)}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(5)::before{content:"Próxima cobrança: "}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(7),
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td[colspan]{grid-column:1 / -1}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td[colspan]::before{content:none}
  body.mj-role-cobrador[data-mj-system-theme] #realCollectorClientsList td:nth-child(7) .btn{flex:1 1 140px;min-height:44px}
}

/* Histórico de entradas e saídas: no celular cada lançamento vira um cartão (data e valor em cima; tipo, descrição, quem registrou, situação e ação). */
@media(max-width:720px){
  body[data-mj-system-theme] table:has(#cashMovementHistoryRows){display:block;width:100%;min-width:0!important}
  body[data-mj-system-theme] table:has(#cashMovementHistoryRows) thead{display:none}
  body[data-mj-system-theme] div:has(> table > #cashMovementHistoryRows){overflow-x:visible!important}
  body[data-mj-system-theme] #cashMovementHistoryRows{display:flex;flex-direction:column;gap:10px}
  body[data-mj-system-theme] #cashMovementHistoryRows tr{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
  body[data-mj-system-theme] #cashMovementHistoryRows td{display:block;padding:0;border:0;min-width:0;overflow-wrap:anywhere}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(1){grid-column:1;grid-row:1;color:var(--muted);font-size:13px}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(2){grid-column:1;grid-row:2;font-weight:800}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(4){grid-column:2;grid-row:1 / span 2;align-self:start;text-align:right;font-size:16px;font-weight:800;white-space:nowrap;font-variant-numeric:tabular-nums}
  body[data-mj-system-theme] #cashMovementHistoryRows td:is(:nth-child(3),:nth-child(5),:nth-child(6),:nth-child(7)),
  body[data-mj-system-theme] #cashMovementHistoryRows td[colspan]{grid-column:1 / -1}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(5){color:var(--muted);font-size:13px}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(5)::before{content:"Registrado por: "}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(7){color:var(--muted);font-size:13px}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(7){text-align:right}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(7) .cash-adjust-btn{width:auto;min-height:40px;padding:8px 20px}
  body[data-mj-system-theme] #cashMovementHistoryRows td:nth-child(7) .cash-adjust-form{text-align:left}
}

/* Ajustar lançamento (histórico de entradas e saídas): valor certo, motivo e ações lado a lado. */
body[data-mj-system-theme] .cash-adjust-form{display:grid;gap:8px;margin-top:8px;padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--panel2)}
body[data-mj-system-theme] .cash-adjust-form label{display:grid;gap:4px;font-weight:700;font-size:13px}
body[data-mj-system-theme] .cash-adjust-form input,
body[data-mj-system-theme] .cash-adjust-form textarea{width:100%;box-sizing:border-box}
body[data-mj-system-theme] .cash-adjust-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px}
body[data-mj-system-theme] .cash-adjust-actions .btn{flex:1 1 140px;min-height:44px}
body[data-mj-system-theme] .cash-adjust-status:empty{display:none}
/* Correções de valor: no celular cada pedido vira um cartão. */
@media(max-width:720px){
  body[data-mj-system-theme] .value-fix-table,
  body[data-mj-system-theme] .value-fix-table tbody,
  body[data-mj-system-theme] .value-fix-table tr,
  body[data-mj-system-theme] .value-fix-table td{display:block;width:auto;min-width:0!important}
  body[data-mj-system-theme] .value-fix-table thead{display:none}
  body[data-mj-system-theme] .value-fix-table tr{border:1px solid var(--line);border-radius:14px;padding:12px 14px;margin:8px 0;background:var(--panel)}
  body[data-mj-system-theme] .value-fix-table td{border:0;padding:3px 0;overflow-wrap:anywhere}
  body[data-mj-system-theme] .value-fix-table td .btn{min-height:44px;margin-top:6px}
}

/* Celular: qualquer outra tabela vira cartões ("Coluna: valor"), sem arrastar para o lado (tabelas-cartoes.js põe o nome da coluna). */
@media(max-width:720px){
  body[data-mj-system-theme] table.mj-cards{display:block;width:100%;min-width:0!important}
  body[data-mj-system-theme] table.mj-cards thead{display:none}
  body[data-mj-system-theme] table.mj-cards tbody{display:flex;flex-direction:column;gap:10px}
  body[data-mj-system-theme] table.mj-cards tr{display:flex;flex-direction:column;gap:6px;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
  body[data-mj-system-theme] table.mj-cards td{display:block;padding:0;border:0;min-width:0;overflow-wrap:anywhere;text-align:left}
  body[data-mj-system-theme] table.mj-cards td[data-label]{display:grid;grid-template-columns:minmax(84px,38%) minmax(0,1fr);gap:8px;align-items:baseline}
  body[data-mj-system-theme] table.mj-cards td[data-label]::before{content:attr(data-label);font-size:12px;font-weight:700;color:var(--muted)}
  body[data-mj-system-theme] table.mj-cards td:first-child[data-label]{display:block;font-size:15px;font-weight:700}
  body[data-mj-system-theme] table.mj-cards td:first-child[data-label]::before{content:none}
  body[data-mj-system-theme] table.mj-cards td:empty{display:none}
  body[data-mj-system-theme] table.mj-cards td .btn{min-height:40px}
  body[data-mj-system-theme] div:has(> table.mj-cards),
  body[data-mj-system-theme] .card:has(> table.mj-cards){overflow-x:visible}
}

/* Solicitações de renovação: separadas por dia (Hoje, Ontem...). */
body[data-mj-system-theme] #pendingRenewalsBody tr.rn-dia td{background:var(--panel2);padding:8px 12px;font-size:14px}
body[data-mj-system-theme] #pendingRenewalsBody tr.rn-dia small{color:var(--muted);font-weight:600}
body[data-mj-system-theme] #pendingRenewalsBody td.rn-data{white-space:nowrap;color:var(--muted)}
/* No celular, cartão compacto: nome e situação em cima; linha e hora; valores em três colunas; ações embaixo. */
@media(max-width:720px){
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody{gap:8px}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody tr.rn-dia{display:block;padding:0;border:0;background:none}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody tr.rn-dia td{display:block;background:none;padding:10px 2px 0;font-size:15px}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody tr.rn{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px 10px;padding:10px 12px;background:var(--panel)}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody tr.rn td{font-size:13px}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody tr.rn td[data-label]::before{font-size:11px;margin-bottom:1px}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-cliente{grid-area:1/1/2/-1;font-size:15px;font-weight:700}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-status{grid-area:2/3/3/4;justify-self:end;align-self:center}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-status .tag{font-size:11px;padding:3px 8px;white-space:nowrap}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-linha{grid-area:2/1/3/2;color:var(--muted)}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-data{grid-area:2/2/3/3;align-self:center}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-cliente::before,
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-status::before,
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-linha::before,
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-data::before,
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-comp::before,
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-acao::before{display:none}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-atual{grid-area:3/1/4/2}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-novo{grid-area:3/2/4/4}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-saldo{grid-area:4/1/5/2}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-taxa{grid-area:4/2/5/3}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-liq{grid-area:4/3/5/4}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-comp{grid-area:5/1/6/-1}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-comp .btn{min-height:36px;padding:6px 12px;width:auto}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-comp .tag{display:inline-block}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-acao{grid-area:6/1/7/-1}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-acao .btn{flex:1 1 0;min-height:42px}
  body[data-mj-system-theme] #renovacoesFinanceiro #pendingRenewalsBody td.rn-acao.rn-vazio{display:none}
}
}

/* Botões do topo da linha: cada ação com sua cor. Abrir caixa em cor cheia; as demais em tom suave. */
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-editar,
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-transferir,
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-firma,
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-testar{background:color-mix(in srgb,var(--tom) 13%,var(--panel));color:color-mix(in srgb,var(--tom) 78%,var(--text));border:1px solid color-mix(in srgb,var(--tom) 38%,var(--panel));box-shadow:none}
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-editar{--tom:#64748b}
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-transferir{--tom:#7c3aed}
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-firma{--tom:#059669}
body[data-mj-system-theme] #lineDetail .topbar .actions .btn.acao-testar{--tom:#d97706}
body[data-mj-system-theme] #lineDetail .topbar .actions .btn:is(.acao-editar,.acao-transferir,.acao-firma,.acao-testar):hover{background:color-mix(in srgb,var(--tom) 22%,var(--panel))}
body[data-mj-system-theme] #lineDetail .topbar .actions #lineCashAction.primary:not(.danger){background:#1e3a8a;border-color:#1e3a8a;color:#fff}
body[data-mj-system-theme] #lineDetail .topbar .actions #lineCashAction.primary:not(.danger):hover{background:#1e40af}

/* Menu lateral: todos os itens com a mesma altura, ícone numa coluna fixa e o mesmo destaque ao passar o mouse.
   Nomes longos são encurtados (ver MJ_NAV_NOMES no index.html) para caber numa linha. */
body[data-mj-system-theme] aside nav#nav{gap:2px}
body[data-mj-system-theme] aside nav#nav button{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;margin:0;padding:7px 10px;border:0;border-radius:9px;background:transparent;font-size:13.5px;font-weight:600;line-height:1.3;text-align:left;box-shadow:none;transform:none;opacity:1;transition:background .12s ease,color .12s ease}
body[data-mj-system-theme] aside nav#nav button:hover{background:var(--panel2);color:var(--text)}
body[data-mj-system-theme] aside nav#nav button.active{background:var(--panel2);color:var(--text);box-shadow:inset 3px 0 0 var(--info,#60a5fa);font-weight:700}
body[data-mj-system-theme] aside nav#nav .mj-nav-ico{flex:0 0 22px;text-align:center;font-size:14px;line-height:1}
body[data-mj-system-theme] aside nav#nav .mj-nav-txt{flex:1;min-width:0;display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body[data-mj-system-theme] aside nav#nav .badge{float:right;margin:1px 0 0 6px;padding:1px 7px;font-size:11px;line-height:16px}
body[data-mj-system-theme] aside nav#nav button.principal-quick{min-height:34px;padding-left:32px;font-size:13px;font-weight:500;color:var(--muted);border-left:0}
body[data-mj-system-theme] aside nav#nav button.principal-quick .mj-nav-ico{flex-basis:18px;font-size:12px}
body[data-mj-system-theme] aside nav#nav button[data-view="conciliacaoFinanceiro"]{border:0;background:color-mix(in srgb,#22c55e 14%,transparent);color:var(--text)}
body[data-mj-system-theme] aside nav#nav button[data-view="conciliacaoFinanceiro"]:hover,
body[data-mj-system-theme] aside nav#nav button[data-view="conciliacaoFinanceiro"].active{background:color-mix(in srgb,#22c55e 24%,transparent)}
body[data-mj-system-theme] aside nav#nav .mj-nav-primary{gap:2px;margin:0 0 4px;padding:6px 0 10px;border-bottom:0}
body[data-mj-system-theme] aside nav#nav .mj-nav-primary::before{padding:0 10px 6px;font-size:12px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--muted)}
/* Grupos: linha igual a um item (nome normal, setinha à direita), sem caixas nem linhas em volta. */
body[data-mj-system-theme] aside nav#nav .nav-section.mj-nav-toggle{display:flex;align-items:center;justify-content:space-between;min-height:36px;margin:2px 0 0;padding:7px 10px;border:0;border-radius:9px;background:transparent;font-size:13px;font-weight:600;letter-spacing:0;text-transform:none;color:var(--muted)}
body[data-mj-system-theme] aside nav#nav .nav-section.mj-nav-toggle:hover{background:var(--panel2);color:var(--text)}
body[data-mj-system-theme] aside nav#nav .nav-section.mj-nav-toggle:not(.mj-nav-collapsed){color:var(--text)}
body[data-mj-system-theme] aside nav#nav .mj-nav-primary + .nav-section{margin-top:8px}
body[data-mj-system-theme] aside nav#nav .mj-nav-caret{font-size:0;width:7px;height:7px;margin-right:4px;border-right:1.7px solid currentColor;border-bottom:1.7px solid currentColor;opacity:.7;transform:rotate(45deg) translate(-2px,-2px);transition:transform .15s ease}
body[data-mj-system-theme] aside nav#nav .nav-section.mj-nav-toggle.mj-nav-collapsed .mj-nav-caret{transform:rotate(-45deg)}
body[data-mj-system-theme] aside nav#nav .mj-nav-search{margin:0 0 6px}
body[data-mj-system-theme] aside nav#nav .mj-nav-search span{padding:0 10px}
body[data-mj-system-theme] aside nav#nav [data-clt-root]{margin-bottom:6px}
body[data-mj-system-theme] aside nav#nav [data-clt-root] button::before{content:"⚖";flex:0 0 22px;text-align:center;font-size:15px}
/* Rodapé da barra lateral (Cores do sistema) com o mesmo visual dos itens do menu. */
body[data-mj-system-theme] aside .mj-menu-settings button{display:flex;align-items:center;gap:10px;width:100%;min-height:38px;padding:7px 10px;border:0;border-radius:9px;background:transparent;color:var(--muted);font-size:13.5px;font-weight:600;text-align:left;cursor:pointer}
body[data-mj-system-theme] aside .mj-menu-settings button:hover{background:var(--panel2);color:var(--text)}
body[data-mj-system-theme] aside .mj-menu-settings .mj-nav-ico{flex:0 0 22px;text-align:center;font-size:14px}
/* "Simular perfil" fica escondido no login real; sem isto sobrava uma faixa cinza vazia acima do rodapé. */
body[data-mj-system-theme].real-auth-mode .sidebar .side-bottom:not(:has(> :not(.rolebox))){display:none!important}
/* Linhas / Carteiras: na coluna Caixa, a etiqueta fica à esquerda e "Conciliação" sempre na mesma posição à direita. */
body[data-mj-system-theme] .linha-caixa{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:8px;min-width:240px}
body[data-mj-system-theme] .linha-caixa .tag{justify-self:start;white-space:nowrap}
/* Acabamento comum a todos os temas: cada tema tem duas cores (--accent e --accent-2) e as cores das faixas
   dos cartões (--m1 a --m5), escolhidas em james-preferencias.js para o fundo claro ou escuro. */
body[data-mj-system-theme] .sidebar{background:linear-gradient(180deg,var(--panel),color-mix(in srgb,var(--accent) 4%,var(--panel)));border-right-color:var(--line)}

/* Caixa do usuário com a segunda cor do tema e Sair em vermelho suave. */
body[data-mj-system-theme] .user-session{border-color:color-mix(in srgb,var(--accent-2) 35%,var(--line));background:linear-gradient(160deg,color-mix(in srgb,var(--accent-2) 8%,var(--panel)),var(--panel) 65%)}
body[data-mj-system-theme] .user-session strong{color:color-mix(in srgb,var(--accent-2) 80%,var(--text))}
body[data-mj-system-theme] .user-session .btn{background:var(--sair-bg);border-color:var(--sair-borda);color:var(--sair-txt);font-weight:700}
body[data-mj-system-theme] .user-session .btn:hover{background:color-mix(in srgb,#ef4444 22%,var(--panel));border-color:#ef4444}

/* Menu: item ativo na cor do tema. */
body[data-mj-system-theme] aside nav#nav button.active{background:color-mix(in srgb,var(--accent) 13%,transparent);color:color-mix(in srgb,var(--accent) 65%,var(--text));box-shadow:inset 3px 0 0 var(--accent)}
body[data-mj-system-theme] aside nav#nav .mj-nav-primary::before,
body[data-mj-system-theme] aside nav#nav .nav-section.mj-nav-toggle:not(.mj-nav-collapsed){color:color-mix(in srgb,var(--accent-2) 75%,var(--text))}

/* Título da tela com um traço nas duas cores do tema. */
body[data-mj-system-theme] .topbar .title h2::after{content:"";display:block;width:44px;height:3px;margin-top:8px;border-radius:3px;background:linear-gradient(90deg,var(--accent),var(--accent-2))}

/* Topo das telas: título à esquerda sem quebrar palavra por palavra; ações alinhadas, do mesmo tamanho, quebrando em linhas inteiras. */
body[data-mj-system-theme] .topbar{flex-wrap:wrap;gap:14px 20px;align-items:flex-start}
/* Só na tela grande: no celular o topo do cobrador é empilhado (coluna) e os 340px virariam altura, um vão em branco. */
@media(min-width:721px){body[data-mj-system-theme] .topbar .title{flex:1 1 340px;min-width:min(100%,340px)}}
body[data-mj-system-theme] .topbar .actions{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;flex:0 1 auto;max-width:100%}
body[data-mj-system-theme] .topbar .actions .btn{white-space:nowrap;min-height:40px}

/* Cartões: sombra leve e contorno; os de número com uma faixa colorida no topo e no rótulo. */
body[data-mj-system-theme] .card{box-shadow:var(--sombra);border-color:color-mix(in srgb,var(--accent) 10%,var(--line))}
body[data-mj-system-theme] .card.metric{--c:var(--m1);border-top:3px solid var(--c);background:linear-gradient(180deg,color-mix(in srgb,var(--c) 6%,var(--panel)),var(--panel) 70%)}
body[data-mj-system-theme] .card.metric > span:first-child{color:color-mix(in srgb,var(--c) 75%,var(--text));font-weight:700}
body[data-mj-system-theme] :is(.grid2,.grid3,.grid4,.grid5) > .card.metric:nth-child(5n+2){--c:var(--m2)}
body[data-mj-system-theme] :is(.grid2,.grid3,.grid4,.grid5) > .card.metric:nth-child(5n+3){--c:var(--m3)}
body[data-mj-system-theme] :is(.grid2,.grid3,.grid4,.grid5) > .card.metric:nth-child(5n+4){--c:var(--m4)}
body[data-mj-system-theme] :is(.grid2,.grid3,.grid4,.grid5) > .card.metric:nth-child(5n){--c:var(--m5)}
body[data-mj-system-theme] .card > h3:first-child{display:flex;align-items:center;gap:8px}
body[data-mj-system-theme] .card > h3:first-child::before{content:"";flex:0 0 4px;height:16px;border-radius:4px;background:var(--accent)}

/* Avisos comuns com um toque da cor do tema. */
body[data-mj-system-theme] .notice:not(.warn):not(.danger){background:color-mix(in srgb,var(--accent) 7%,var(--panel));border-left-color:var(--accent)}

/* Tabelas: cabeçalho na segunda cor e linha destacada ao passar o mouse. */
body[data-mj-system-theme] th{color:color-mix(in srgb,var(--accent-2) 60%,var(--muted))}
body[data-mj-system-theme] tbody tr:hover > td{background:color-mix(in srgb,var(--accent) 5%,transparent)}

/* Botões comuns: o contorno ganha a cor do tema ao passar o mouse. Campos com foco na cor do tema. */
body[data-mj-system-theme] .btn:not(.primary):not(.danger):hover{border-color:color-mix(in srgb,var(--accent) 60%,var(--line))}
body[data-mj-system-theme] :is(input,select,textarea):focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 22%,transparent)}

/* Renovações: busca e período usam os mesmos campos legíveis do restante do app. */
body[data-mj-system-theme] .collector-renewal-filters{max-width:100%;min-width:0}
body[data-mj-system-theme] #lineVisionCardsV265{grid-template-columns:repeat(auto-fit,minmax(min(100%,390px),1fr))!important}
/* Tabelas largas rolam no próprio quadro, sem alargar toda a página. */
body[data-mj-system-theme] .main{min-width:0}
@media(max-width:720px){
  body[data-mj-system-theme] .line-vision-card-v265>div:nth-child(2){grid-template-columns:repeat(auto-fit,minmax(min(100%,170px),1fr))!important}
}
body[data-mj-system-theme] .collector-renewal-filters :is(input,select){box-sizing:border-box;min-height:44px;max-width:100%;padding:10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--panel);color:var(--text);font:inherit}
@media(max-width:720px){
  body[data-mj-system-theme] .collector-renewal-filters{width:100%}
  body[data-mj-system-theme] .collector-renewal-filters > :is(input,select){width:100%;min-width:0!important}
  body[data-mj-system-theme] .collector-renewal-filters .mj-period-nav-v364{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
  body[data-mj-system-theme] .collector-renewal-filters .mj-period-nav-v364 .btn{min-width:0;padding-inline:8px}
}

/* Alto contraste: sem gradientes nem sombras, contornos brancos. */
body[data-mj-system-theme][data-mj-system-theme="alto_contraste"] :is(.sidebar,.user-session,.card.metric){background:var(--panel)}
body[data-mj-system-theme][data-mj-system-theme="alto_contraste"] .card{box-shadow:none;border-color:var(--line)}

/* Cobrador: a tabela de cobranças segue o tema (a correção V325 deixava parcela, pagas e restantes sempre em branco). */
body.mj-role-cobrador[data-mj-system-theme] #collectorClientsTable tbody td:is(:nth-child(2),:nth-child(3),:nth-child(4)){background:transparent!important;border-color:var(--line)!important;color:var(--text)!important}
body.mj-role-cobrador[data-mj-system-theme] #collectorClientsTable tbody td:is(:nth-child(2),:nth-child(3),:nth-child(4))::before{color:var(--muted)!important}
body.mj-role-cobrador[data-mj-system-theme] #collectorClientsTable tbody tr{box-shadow:none!important}
body[data-mj-system-theme] .mj-parcial{color:var(--warn)}

/* Nomes clicáveis (linhas, clientes): cor do texto em negrito, que se lê bem em qualquer tema;
   o destaque aparece ao passar o mouse. Antes eram azul-claro, quase sumindo no tema claro. */
body[data-mj-system-theme] .link-btn{color:var(--text);font-weight:700}
body[data-mj-system-theme] .link-btn:hover{color:var(--accent);text-decoration:underline;text-underline-offset:3px}


/* Botões do caixa por função: Entrada (verde forte) e Fechar caixa (vermelho forte) são as ações principais;
   Saída, Enviar ao financeiro e Conciliação ganham um tom cada; os históricos ficam neutros.
   Antes havia dois verdes iguais (Entrada e Enviar) e o resto sem cor. */
body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton) .btn:is(#realCashExitButton,#realCashTransferButton,#conciliacaoFaseAButton){background:color-mix(in srgb,var(--tom) 13%,var(--panel));color:color-mix(in srgb,var(--tom) 78%,var(--text));border:1.5px solid color-mix(in srgb,var(--tom) 45%,var(--panel));box-shadow:none;font-weight:800}
body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton) .btn:is(#realCashExitButton,#realCashTransferButton,#conciliacaoFaseAButton):hover{background:color-mix(in srgb,var(--tom) 22%,var(--panel))}
body[data-mj-system-theme] .topbar .actions #realCashExitButton{--tom:#dc2626}
body[data-mj-system-theme] .topbar .actions #realCashTransferButton{--tom:#2563eb}
body[data-mj-system-theme] .topbar .actions #conciliacaoFaseAButton{--tom:#7c3aed}
body[data-mj-system-theme] .topbar .actions #realCashEntryButton{background:#15803d;border-color:#15803d;color:#fff;font-weight:800}
body[data-mj-system-theme] .topbar .actions #realCashEntryButton:hover{background:#166534}
body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton) .btn:is(#repasseCorrectionsButton,[onclick^="openCashMovementHistory"]){background:var(--panel);color:var(--text);border:1px solid var(--line);box-shadow:none;font-weight:700}
body[data-mj-system-theme] .topbar .actions #realCloseCashButton{background:#b91c1c;border-color:#b91c1c;color:#fff;font-weight:800}
/* Tela grande: são muitos botões; ficam numa linha própria abaixo do título, sem quebrar o texto. */
@media(min-width:721px){
  body[data-mj-system-theme] .topbar:has(#realCashEntryButton){flex-wrap:wrap!important}
  body[data-mj-system-theme] .topbar:has(#realCashEntryButton)>.title{flex:1 1 100%!important;max-width:none!important}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton){flex:1 1 100%!important;flex-wrap:wrap!important;justify-content:flex-start!important}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton) .btn{white-space:nowrap}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton)>*{order:7}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton)>:is(#operationalCashLineSelect,.sl-wrap){order:0}
  body[data-mj-system-theme] .topbar .actions #realCashEntryButton{order:1}
  body[data-mj-system-theme] .topbar .actions #realCashExitButton{order:2}
  body[data-mj-system-theme] .topbar .actions #realCashTransferButton{order:3}
  body[data-mj-system-theme] .topbar .actions #conciliacaoFaseAButton{order:4}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton) .btn:is(#repasseCorrectionsButton,[onclick^="openCashMovementHistory"]){order:5}
  body[data-mj-system-theme] .topbar .actions #realCloseCashButton{order:9}
}
/* Celular: grade de duas colunas, na ordem de uso — Entrada e Saída lado a lado, Enviar ao financeiro,
   Conciliação, os dois históricos lado a lado e Fechar caixa por último. */
@media(max-width:720px){
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton){display:grid;grid-template-columns:1fr 1fr;gap:8px;width:100%}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton)>*{grid-column:1/-1;order:7;width:100%;min-width:0;margin:0}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton) .btn{white-space:normal;min-height:48px;line-height:1.2;padding:8px 10px;font-size:15px}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton)>:is(#operationalCashLineSelect,.sl-wrap){order:0}
  body[data-mj-system-theme] .topbar .actions #realCashEntryButton{grid-column:auto;order:1}
  body[data-mj-system-theme] .topbar .actions #realCashExitButton{grid-column:auto;order:2}
  body[data-mj-system-theme] .topbar .actions #realCashTransferButton{order:3}
  body[data-mj-system-theme] .topbar .actions #conciliacaoFaseAButton{order:4}
  body[data-mj-system-theme] .topbar .actions:has(#realCashEntryButton) .btn:is(#repasseCorrectionsButton,[onclick^="openCashMovementHistory"]){grid-column:auto;order:5;font-size:14px}
  body[data-mj-system-theme] .topbar .actions #realCloseCashButton{order:9}
}


/* Reposições do Edson e conferência do Mestre. */

body[data-mj-system-theme] #erDialog{padding:0;width:min(620px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--text);box-sizing:border-box}
body[data-mj-system-theme] #erDialog[open]{display:flex;flex-direction:column}
body[data-mj-system-theme] #erDialog::backdrop{background:rgba(15,23,42,.45)}
body[data-mj-system-theme] .er-panel{margin-top:16px;scroll-margin-top:20px}
body[data-mj-system-theme] .er-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}
body[data-mj-system-theme] .er-heading h3{margin:0}
body[data-mj-system-theme] .er-list{display:grid;gap:10px;margin-top:12px}
body[data-mj-system-theme] .er-request{border:1px solid var(--line);padding:14px;border-radius:12px;overflow-wrap:anywhere}
body[data-mj-system-theme] .er-request p{margin:8px 0}
body[data-mj-system-theme] #edsonCaixa .actions{flex-wrap:wrap}
@media(max-width:480px){body[data-mj-system-theme] #edsonCaixa .actions{width:100%}body[data-mj-system-theme] #edsonCaixa .actions>.btn{width:100%;min-height:48px}body[data-mj-system-theme] #erDialog .ec-dialog-footer{flex-wrap:wrap}body[data-mj-system-theme] #erDialog .ec-dialog-footer .btn{min-width:110px}}


body.mj-role-lider-captacao[data-mj-system-theme] #liderCaptacaoStandaloneNav{padding-bottom:8px;overflow:visible}
body.mj-role-lider-captacao[data-mj-system-theme] #liderCaptacaoStandaloneNav button{margin:2px 0;padding:10px 12px;min-height:42px;border:0;border-radius:10px;background:transparent;color:var(--text);font:inherit;font-size:14px;font-weight:600;text-align:left;line-height:1.35;box-shadow:none}
body.mj-role-lider-captacao[data-mj-system-theme] #liderCaptacaoStandaloneNav button:hover{background:var(--panel2)}
body.mj-role-lider-captacao[data-mj-system-theme] #liderCaptacaoStandaloneNav button.active{background:color-mix(in srgb,var(--accent) 12%,var(--panel));box-shadow:inset 3px 0 0 var(--accent);color:var(--accent);font-weight:800}
body.mj-role-lider-captacao[data-mj-system-theme] #liderCaptacaoStandaloneNav .nav-section{margin-top:8px;padding:10px 12px;border-radius:10px;font-size:12px;font-weight:700;color:var(--muted);letter-spacing:.02em}
body.mj-role-lider-captacao[data-mj-system-theme] :is(#liderCaptacaoPainel,#desempenhoCaptacao,#relatorioCaptacoes) :is(select,input[type=date]){box-sizing:border-box;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:var(--panel);color:var(--text);font:inherit;max-width:100%;min-width:0}
body.mj-role-lider-captacao[data-mj-system-theme] :is(#liderCaptacaoPainel,#desempenhoCaptacao,#relatorioCaptacoes) .toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;padding:14px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
body[data-mj-system-theme] .ca-app .card{margin-top:14px}
body[data-mj-system-theme] .ca-app .grid4 .card{margin-top:0}
body[data-mj-system-theme] .ca-app .actions,
body[data-mj-system-theme] .ca-presets,
body[data-mj-system-theme] .ca-list-filters{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
body[data-mj-system-theme] .ca-filters{display:flex;gap:12px;flex-wrap:wrap;align-items:end}
body[data-mj-system-theme] .ca-presets{flex-basis:100%}
body[data-mj-system-theme] .ca-app label{display:flex;flex-direction:column;gap:6px;font-size:13px;font-weight:700;flex:1 1 150px;min-width:0}
body[data-mj-system-theme] .ca-app :is(input,select){box-sizing:border-box;width:100%;min-height:44px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;color:var(--text);background:var(--panel);font:inherit}
body[data-mj-system-theme] .ca-hint{font-size:13px;color:var(--muted);line-height:1.6}
body[data-mj-system-theme] .ca-client-list{display:grid;gap:12px;margin-top:14px}
body[data-mj-system-theme] .ca-client{padding:16px;border:1px solid var(--line);border-radius:14px;background:var(--panel)}
body[data-mj-system-theme] .ca-client-top{display:flex;justify-content:space-between;align-items:start;flex-wrap:wrap;gap:10px}
body[data-mj-system-theme] .ca-client h4{margin:0;font-size:16px}body[data-mj-system-theme] .ca-client p{margin:10px 0;color:var(--muted)}
body[data-mj-system-theme] .ca-client dl{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:0}
body[data-mj-system-theme] .ca-client dt{font-size:12px;color:var(--muted)}body[data-mj-system-theme] .ca-client dd{margin:5px 0 0;font-size:14px;font-weight:700;overflow-wrap:anywhere}
body[data-mj-system-theme] .ca-dialog{padding:0;width:min(600px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--panel);color:var(--text);box-sizing:border-box}
body[data-mj-system-theme] .ca-dialog[open]{display:flex;flex-direction:column}body[data-mj-system-theme] .ca-dialog::backdrop{background:rgba(15,23,42,.45)}
body[data-mj-system-theme] .ca-dialog button:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:720px){
 body[data-mj-system-theme] .ca-app .actions{width:100%}body[data-mj-system-theme] .ca-app .actions>.btn{flex:1 1 145px;min-height:46px}
 body[data-mj-system-theme] .ca-client dl{grid-template-columns:repeat(2,minmax(0,1fr))}body[data-mj-system-theme] .ca-presets .btn{flex:1;min-width:60px}
 body.mj-role-lider-captacao[data-mj-system-theme] :is(#liderCaptacaoPainel,#desempenhoCaptacao,#relatorioCaptacoes) .toolbar>select{flex:1 1 100%;width:100%}
 body.mj-role-lider-captacao[data-mj-system-theme] :is(#liderCaptacaoPainel,#desempenhoCaptacao,#relatorioCaptacoes) .toolbar>input[type=date]{flex:1 1 135px}
}

/* O menu próprio do Vitor ocupa o espaço restante; Cores permanece no rodapé. */
@media(min-width:721px){
 body.mj-role-lider-captacao[data-mj-system-theme] .sidebar>#liderCaptacaoStandaloneNav{flex:1 1 0;min-height:0;overflow-y:auto;overflow-x:hidden;padding-right:4px;scrollbar-width:thin;scrollbar-color:var(--muted) transparent}
}

/* Conferência financeira: a caixa de confirmação mantém tamanho de checkbox. */
body[data-mj-system-theme] .ca-dialog input[type=checkbox]{width:20px;min-height:20px;height:20px;flex:0 0 20px;margin:0;align-self:flex-start}
body[data-mj-system-theme] .ca-dialog label:has(input[type=checkbox]){flex-direction:row;align-items:flex-start;gap:10px;line-height:1.45}

/* Dar baixa: verde fixo com texto branco em todos os temas e tamanhos de tela. */
body :is(#collectorClientsTable,#realCollectorClientsList) .btn.primary{background:#15803d!important;border:1.5px solid #15803d!important;color:#fff!important}
body :is(#collectorClientsTable,#realCollectorClientsList) .btn.primary:hover:not(:disabled){background:#166534!important;border-color:#166534!important}

/* Pacote de ajustes: ações do Caixa Operacional para Mestre e Financeiro. */
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar{flex-wrap:wrap!important}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.title{flex:1 1 100%!important;max-width:none!important}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions{
 display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr)) minmax(180px,.8fr);
 gap:10px 12px;width:100%;flex:1 1 100%!important;align-items:stretch
}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions>*{order:0!important;min-width:0;max-width:100%;margin:0;grid-column:auto;grid-row:auto}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions .btn{min-height:44px;padding:10px 12px;white-space:normal;line-height:1.3}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions>:is(#operationalCashLineSelect,.sl-wrap){grid-column:1 / 4;grid-row:1}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa .sl-gatilho{width:100%;min-width:0;min-height:48px}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa #realCashEntryButton{grid-column:1;grid-row:2}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa #realCashExitButton{grid-column:2;grid-row:2}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa #realCashTransferButton{grid-column:3;grid-row:2}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa #conciliacaoFaseAButton{grid-column:1;grid-row:3}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa #repasseCorrectionsButton{grid-column:2;grid-row:3}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa [onclick^="openCashMovementHistory"]{grid-column:3;grid-row:3}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa #realAdjustCashDateButton{grid-column:1;grid-row:4}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa #realTemporaryCloseCashButtonV348{grid-column:2 / 4;grid-row:4}
body:is(.mj-role-mestre,.mj-role-financeiro) #caixa .topbar .actions>:is(#realOpenCashButton,#realCloseCashButton){
 grid-column:4;grid-row:1 / 5;align-self:start;min-height:72px;padding:16px 20px;font-size:18px;font-weight:800
}
@media(max-width:1000px){
 body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions{grid-template-columns:repeat(2,minmax(0,1fr))}
 body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions>*{grid-column:auto!important;grid-row:auto!important;width:100%}
 body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions>:is(#operationalCashLineSelect,.sl-wrap){grid-column:1!important;grid-row:1!important}
 body:is(.mj-role-mestre,.mj-role-financeiro) #caixa .topbar .actions>:is(#realOpenCashButton,#realCloseCashButton){grid-column:2!important;grid-row:1!important;min-height:64px}
}
@media(max-width:560px){
 body:is(.mj-role-mestre,.mj-role-financeiro) #caixa>.topbar>.actions>:is(#operationalCashLineSelect,.sl-wrap){grid-column:1 / -1!important}
 body:is(.mj-role-mestre,.mj-role-financeiro) #caixa .topbar .actions>:is(#realOpenCashButton,#realCloseCashButton){grid-column:1 / -1!important;grid-row:2!important;justify-self:end;width:min(100%,240px);min-height:60px}
}

/* A identificação antiga de versão não aparece na interface dos perfis. */
#mjVisibleBuild,#mjBuildBadge,#buildVersion{display:none!important}

/* Sem seleção: não exibe valores nem ações de uma carteira anterior. */
#caixa.operational-cash-unselected>.grid4,
#caixa.operational-cash-unselected>.topbar>.actions>.btn{display:none!important}
#caixa.operational-cash-unselected>.topbar>.actions>:is(#operationalCashLineSelect,.sl-wrap){grid-column:1 / -1!important;grid-row:1!important}
/* Abrir caixa mantém sua identificação verde em todos os temas. */
body #caixa #realOpenCashButton{background:#047857!important;border-color:#047857!important;color:#fff!important}
body #caixa #realOpenCashButton:hover:not(:disabled){background:#065f46!important;border-color:#065f46!important}

/* Financeiro: cores consistentes por ação, com contraste em temas claros e escuros. */
body.mj-role-financeiro[data-mj-system-theme] .main .btn:not(.primary):not(.danger){
 --fin-soft:#1d4ed8;
 background:color-mix(in srgb,var(--fin-soft) 12%,var(--panel));
 border-color:color-mix(in srgb,var(--fin-soft) 42%,var(--line));
 color:color-mix(in srgb,var(--fin-soft) 70%,var(--text));font-weight:700
}
body.mj-role-financeiro[data-mj-system-theme] .main .btn:not(.primary):not(.danger):hover:not(:disabled){
 background:color-mix(in srgb,var(--fin-soft) 21%,var(--panel))
}
body.mj-role-financeiro[data-mj-system-theme] .btn:is(
 [onclick^="openClosureStatements"],[data-mesa="comprovante"]){--fin-action:#0e7490}
body.mj-role-financeiro[data-mj-system-theme] .btn[onclick^="openClosureOperationalSummary"]{--fin-action:#0f766e}
body.mj-role-financeiro[data-mj-system-theme] .btn[onclick^="openClosureReconciliation"]{--fin-action:#6d28d9}
body.mj-role-financeiro[data-mj-system-theme] .btn[onclick^="openCashDateAdjustment"]{--fin-action:#92400e}
body.mj-role-financeiro[data-mj-system-theme] .btn[onclick^="openReopenCashModal"]{--fin-action:#9a3412}
body.mj-role-financeiro[data-mj-system-theme] .btn:is(
 [onclick^="confirmFinanceClosure"],[data-manual-action="aprovar"],[data-fix-action="aprovar"]),
body.mj-role-financeiro[data-mj-system-theme] #financeRealDashboard .mesa-acoes .btn.primary{--fin-action:#15803d}
body.mj-role-financeiro[data-mj-system-theme] .btn:is(
 [data-manual-action="rejeitar"],[data-fix-action="rejeitar"]){--fin-action:#b91c1c}
body.mj-role-financeiro[data-mj-system-theme] .btn:is(
 [onclick^="openClosureStatements"],[onclick^="openClosureOperationalSummary"],
 [onclick^="openClosureReconciliation"],[onclick^="openCashDateAdjustment"],
 [onclick^="openReopenCashModal"],[onclick^="confirmFinanceClosure"],
 [data-manual-action="aprovar"],[data-manual-action="rejeitar"],
 [data-fix-action="aprovar"],[data-fix-action="rejeitar"],[data-mesa="comprovante"]),
body.mj-role-financeiro[data-mj-system-theme] #financeRealDashboard .mesa-acoes .btn.primary{
 background:var(--fin-action)!important;border-color:var(--fin-action)!important;color:#fff!important;
 box-shadow:0 2px 5px color-mix(in srgb,var(--fin-action) 20%,transparent);font-weight:750
}
body.mj-role-financeiro[data-mj-system-theme] .btn:is(
 [onclick^="openClosureStatements"],[onclick^="openClosureOperationalSummary"],
 [onclick^="openClosureReconciliation"],[onclick^="openCashDateAdjustment"],
 [onclick^="openReopenCashModal"],[onclick^="confirmFinanceClosure"],
 [data-manual-action="aprovar"],[data-manual-action="rejeitar"],
 [data-fix-action="aprovar"],[data-fix-action="rejeitar"],[data-mesa="comprovante"]):hover:not(:disabled),
body.mj-role-financeiro[data-mj-system-theme] #financeRealDashboard .mesa-acoes .btn.primary:hover:not(:disabled){filter:brightness(.9)}
body.mj-role-financeiro[data-mj-system-theme] .main .btn:focus-visible{
 outline:3px solid color-mix(in srgb,var(--fin-action,var(--accent)) 65%,var(--text));outline-offset:3px
}
body.mj-role-financeiro[data-mj-system-theme] .card.metric{
 background:linear-gradient(145deg,color-mix(in srgb,var(--c,var(--accent)) 13%,var(--panel)),var(--panel) 80%)
}
body.mj-role-financeiro[data-mj-system-theme] .main table thead th{
 background:color-mix(in srgb,#0891b2 10%,var(--panel));border-bottom-color:color-mix(in srgb,#0891b2 40%,var(--line))
}
body.mj-role-financeiro[data-mj-system-theme] #financeClosuresBody [data-finance-date-group] th{
 background:color-mix(in srgb,#d97706 10%,var(--panel))!important;border-left-color:#b45309!important;color:var(--text)
}
/* Nova captação do Soares: campos e referências cabem na área de rolagem. */
body.mj-role-adm-captacao #modal .modalbox:has(#newClientFullName){width:min(780px,calc(100vw - 40px));box-sizing:border-box}
body.mj-role-adm-captacao #modalBody:has(#newClientFullName){min-width:0;scrollbar-gutter:stable;padding-right:12px}
body.mj-role-adm-captacao #modalBody:has(#newClientFullName) .formgrid{grid-template-columns:repeat(2,minmax(0,1fr))}
body.mj-role-adm-captacao #modalBody:has(#newClientFullName) :is(.formgrid>*,.v298-social-row>*,.v298-reference-row>*){min-width:0}
body.mj-role-adm-captacao #modalBody:has(#newClientFullName) :is(input,select,textarea){box-sizing:border-box;min-width:0;max-width:100%;min-height:44px}
body.mj-role-adm-captacao #modalBody:has(#newClientFullName) .v298-social-row{grid-template-columns:minmax(0,1fr) minmax(0,2fr) auto!important}
body.mj-role-adm-captacao #modalBody:has(#newClientFullName) .v298-reference-row{grid-template-columns:repeat(3,minmax(0,1fr)) auto!important}
@media(max-width:720px){
 body.mj-role-adm-captacao #modal .modalbox:has(#newClientFullName){width:100%}
 body.mj-role-adm-captacao #modalBody:has(#newClientFullName) .formgrid{grid-template-columns:minmax(0,1fr)!important}
 body.mj-role-adm-captacao #modalBody:has(#newClientFullName) :is(.v298-social-row,.v298-reference-row){grid-template-columns:minmax(0,1fr)!important}
}
