/* Ajustes sobre o Pico.css (ADR 0002). Cores como no mock (docs/mockups). */
:root {
  --fc-entrada: #1f7a4d;
  --fc-saida: #b3402f;
  --fc-previsto: #8a6d1f;
  --fc-mudo: #6b6b66;
}
@media (prefers-color-scheme: dark) {
  :root { --fc-entrada: #5cc48f; --fc-saida: #ef8a78; --fc-previsto: #d9b45a; --fc-mudo: #a3a39c; }
}
.topo { border-bottom: 1px solid var(--pico-muted-border-color); margin-bottom: 1rem; }
.marca { font-weight: 700; text-decoration: none; }
form.sair { margin: 0; }
.visualmente-oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Menu lateral (templates/menu/_menu.html, static/js/menu.js) */
.com-menu { --menu-l: 12.5rem; padding-left: var(--menu-l); }
.com-menu > main { padding-top: 1rem; max-width: 78rem; margin-inline: auto; padding-inline: 1.5rem; }
.icone { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.menu { position: fixed; inset: 0 auto 0 0; z-index: 20; width: var(--menu-l); display: flex; flex-direction: column; overflow: hidden auto; background: var(--pico-background-color); border-right: 1px solid var(--pico-muted-border-color); color: var(--pico-color); }
.menu-topo { display: flex; align-items: center; justify-content: space-between; gap: 0.25rem; padding: 0.75rem 0.5rem 0.5rem 1.1rem; }
.menu .marca-curta { display: none; }
.menu nav { flex: 1; display: flex; flex-direction: column; justify-content: space-between; padding: 0 0.5rem 0.75rem; }
.menu nav ul { display: flex; flex-direction: column; align-items: stretch; margin: 0; padding: 0; }
.menu nav li { padding: 0; list-style: none; }
.menu nav a, .menu .menu-botao, .topo-movel .menu-botao {
  display: flex; align-items: center; gap: 0.75rem; width: 100%; margin: 0; padding: 0.45rem 0.6rem;
  border: 0; border-radius: var(--pico-border-radius); background: none; box-shadow: none;
  color: inherit; font-size: 0.95rem; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.menu nav a:hover, .menu .menu-botao:hover { background: var(--pico-muted-border-color); }
.menu nav a[aria-current="page"] { background: var(--pico-primary-background); color: var(--pico-primary-inverse); }
.menu nav a.destaque:not([aria-current]), .topo-movel .destaque { color: var(--pico-primary); font-weight: 600; }
.menu .menu-recolher { width: auto; padding: 0.35rem; color: var(--fc-mudo); }
.menu-rodape { border-top: 1px solid var(--pico-muted-border-color); padding-top: 0.5rem !important; }
.topo-movel, .menu-fundo { display: none; }
@media (min-width: 769px) {
  .com-menu.menu-recolhido { --menu-l: 3.6rem; }
  .menu-recolhido .menu .rotulo { display: none; }
  .menu-recolhido .menu .marca-curta { display: inline; }
  .menu-recolhido .menu-topo { flex-direction: column; padding: 0.75rem 0.5rem 0.5rem; }
  .menu-recolhido .menu nav a, .menu-recolhido .menu .menu-botao { justify-content: center; }
  .menu-recolhido .menu .menu-recolher .icone { transform: rotate(180deg); }
}
@media (max-width: 768px) {
  .com-menu { padding-left: 0; }
  .com-menu > main { padding-inline: 1rem; }
  .topo-movel {
    position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 0.5rem; color: var(--pico-color);
    padding: 0.35rem 0.75rem; background: var(--pico-background-color);
    border-bottom: 1px solid var(--pico-muted-border-color);
  }
  .topo-movel .menu-botao { width: auto; padding: 0.4rem; }
  .topo-movel .marca { flex: 1; color: inherit; }
  .topo-movel .destaque { display: flex; align-items: center; gap: 0.35rem; text-decoration: none; }
  .menu { width: min(16rem, 85vw); transform: translateX(-100%); transition: transform 0.2s; }
  .menu-aberto .menu { transform: none; box-shadow: 0 0 2rem rgb(0 0 0 / 0.35); }
  .menu .menu-recolher { display: none; }
  /* Botões do cabeçalho das telas menores */
  .cabecalho [role="button"], .cabecalho button, .navegacao [role="button"], .navegacao button { padding: 0.35rem 0.7rem; font-size: 0.9rem; }
  .menu-fundo:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 15; background: rgb(0 0 0 / 0.4); }
}
.aviso { padding: 0.75rem 1rem; }
.aviso-success { border-left: 4px solid var(--fc-entrada); }
.aviso-error, .alerta { border-left: 4px solid var(--fc-saida); }
.login { max-width: 26rem; margin: 3rem auto; }
.login details { margin-top: 2rem; }

.entrada { color: var(--fc-entrada); }
.saida { color: var(--fc-saida); }
.previsto { color: var(--fc-previsto); }
.mudo { color: var(--fc-mudo); }
.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.cards { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.cards article { margin: 0; min-width: 0; }
.rot { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fc-mudo); margin: 0 0 0.25rem; }
.grande { font-size: 1.8rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.linha { display: flex; justify-content: space-between; gap: 0.5rem; font-variant-numeric: tabular-nums; }
.linha > :last-child { white-space: nowrap; text-align: right; }
.tag { display: inline-block; font-size: 0.75rem; padding: 0 0.5rem; border-radius: 1rem; border: 1px solid currentColor; }
.cabecalho { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.cabecalho h2 { margin: 0; }
.navegacao { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; }
.tabela { overflow-x: auto; }
.tabela td, .tabela th { white-space: nowrap; }
.tabela td.desc { white-space: normal; min-width: 12rem; }
.acoes { display: flex; gap: 0.75rem; justify-content: flex-end; font-size: 0.875rem; }
.cancelado td { text-decoration: line-through; color: var(--fc-mudo); }
#modal article { width: min(32rem, 100%); }
.formulario { max-width: 32rem; margin: 0 auto; }
.detalhe summary { cursor: pointer; }
.detalhe table { font-size: 0.875rem; margin: 0.25rem 0 0; }
.detalhe td { padding: 0.15rem 0.5rem; }
/* Nova venda */
.linha-venda { display: flex; gap: 0.5rem; align-items: flex-start; border-bottom: 1px solid var(--pico-muted-border-color); padding-bottom: 0.5rem; margin-bottom: 0.5rem; }
.grade-item { flex: 1; display: grid; gap: 0 0.75rem; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); }
.grade-item label { margin-bottom: 0.25rem; }
.desconto { display: flex; gap: 0.25rem; }
.desconto select { width: 5rem; }
.remover { padding: 0.3rem 0.6rem; margin-top: 1.6rem; }
.check { align-self: center; }
.resumo table { margin-bottom: 0.5rem; }
.pendencias { color: var(--fc-previsto); font-size: 0.875rem; margin-bottom: 0; }
form.conferir { display: flex; gap: 0.25rem; margin: 0; }
form.conferir input { width: 8rem; margin: 0; }
form.conferir button { margin: 0; padding: 0.3rem 0.7rem; }
/* Gráfico de saldo — cores validadas (paleta de referência, slots 1 a 3) */
:root { --fc-serie-1: #2a78d6; --fc-serie-2: #eb6834; --fc-serie-3: #1a8f6a; --fc-grade: #e2e2dc; }
@media (prefers-color-scheme: dark) {
  :root { --fc-serie-1: #3987e5; --fc-serie-2: #d95926; --fc-serie-3: #2fb386; --fc-grade: #3a3a37; }
}
.grafico-area { position: relative; }
.grafico-svg { width: 100%; min-width: 520px; height: auto; display: block; }
.grafico-svg .grade { stroke: var(--fc-grade); stroke-width: 1; }
.grafico-svg .zero { stroke: var(--fc-mudo); stroke-width: 1; }
.grafico-svg .limite { stroke: var(--fc-saida); stroke-width: 1.5; stroke-dasharray: 2 3; }
.grafico-svg .hoje { stroke: var(--fc-mudo); stroke-width: 1; stroke-dasharray: 1 3; }
.grafico-svg .eixo { fill: var(--fc-mudo); font-size: 11px; }
.grafico-svg polyline, .legenda line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.s1 { stroke: var(--fc-serie-1); }
.s2 { stroke: var(--fc-serie-2); }
.s3 { stroke: var(--fc-serie-3); }
.linhas-grafico { margin-bottom: 0.5rem; gap: 0.75rem; }
.linhas-grafico .alternar { font-size: 0.85rem; color: inherit; text-decoration: none; white-space: nowrap; }
.linhas-grafico .alternar:hover { text-decoration: underline; }
.linhas-grafico .alternar.desligada { opacity: 0.45; text-decoration: line-through; }
.linhas-grafico line { stroke-width: 2; stroke-linecap: round; }
.tracejada { stroke-dasharray: 5 4; }
.grafico-svg .ponto { fill: var(--fc-serie-1); stroke: var(--pico-background-color); stroke-width: 2; }
.grafico-svg .cursor { stroke: var(--fc-mudo); stroke-width: 1; }
.grafico-svg .alvo { fill: transparent; cursor: crosshair; }
.legenda { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; font-size: 0.875rem; }
.legenda li { list-style: none; display: flex; align-items: center; gap: 0.4rem; margin: 0; }
.dica { position: absolute; top: 0.5rem; pointer-events: none; background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 0.4rem; padding: 0.35rem 0.6rem; font-size: 0.8rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.topo nav a { white-space: nowrap; }
.grafico { margin-top: 2rem; }
/* Impressão: só o conteúdo do extrato */
@media print {
  .topo, .topo-movel, .menu, .menu-fundo, .nao-imprimir, .aviso { display: none !important; }
  .com-menu { padding-left: 0; }
  .extrato-impressao { box-shadow: none; border: 0; padding: 0; }
  body { background: #fff; color: #000; }
}

/* Painel › "ocultar valores": o número some, a cor (entrada/saída) e o sinal ficam. */
.painel .se-oculto, .valores-ocultos .se-visivel { display: none; }
.valores-ocultos .se-oculto { display: inline; }
.valores-ocultos .v { position: relative; visibility: hidden; white-space: nowrap; }
.valores-ocultos .v::after { content: "•••••"; visibility: visible; position: absolute; right: 0; }
.valores-ocultos .v-eixo { visibility: hidden; }
tr.dia th { background: var(--pico-muted-border-color); font-weight: 600; }

/* Listas como cartões no celular: <table class="cartoes"> e cada célula com um papel
   (c-data, c-desc, c-valor, c-meta, c-extra, c-info, c-acoes). No computador, tabela. */
.so-celular { display: none; }
@media (max-width: 768px) {
  .so-celular { display: inline; }
  /* filtros (form.grid) em duas colunas, sem o espaço do Pico entre os campos */
  form.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.5rem; }
  form.grid label { margin-bottom: 0.5rem; font-size: 0.85rem; }
  form.grid input, form.grid select { margin-bottom: 0; padding-block: 0.4rem; height: auto; }
  form.grid label:has(button) { grid-column: 1 / -1; }
  form.grid button { width: 100%; padding-block: 0.4rem; }
  .nao-celular { display: none; }
  table.cartoes, table.cartoes tbody, table.cartoes tfoot { display: block; }
  table.cartoes thead { display: none; }
  table.cartoes tbody tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-areas: "data desc valor" "data meta extra" "data info info" "data acoes acoes";
    column-gap: 0.75rem; row-gap: 0.1rem; padding: 0.6rem 0.25rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
  }
  table.cartoes td, table.cartoes th { display: block; padding: 0; border: 0; background: none; white-space: normal; }
  table.cartoes td.desc { min-width: 0; }
  table.cartoes td[colspan] { grid-column: 1 / -1; }
  table.cartoes .c-data { grid-area: data; font-variant-numeric: tabular-nums; }
  table.cartoes .c-desc { grid-area: desc; }
  table.cartoes .c-valor { grid-area: valor; font-weight: 600; }
  table.cartoes .c-meta { grid-area: meta; }
  table.cartoes .c-extra { grid-area: extra; text-align: right; }
  table.cartoes .c-info { grid-area: info; text-align: left; }
  table.cartoes .c-meta, table.cartoes .c-extra, table.cartoes .c-info { font-size: 0.8rem; color: var(--fc-mudo); }
  table.cartoes .c-acoes { grid-area: acoes; justify-self: end; font-size: 0.85rem; }
  table.cartoes .c-acoes:empty { display: none; }
  table.cartoes tr.dia, table.cartoes tfoot tr {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem;
    padding: 0.5rem 0.25rem; border-bottom: 1px solid var(--pico-muted-border-color);
  }
  table.cartoes tfoot td:empty { display: none; }
  /* <table class="rotulada">: tabela de números vira um cartão por linha, cada valor
     com o rótulo de data-rotulo ao lado */
  table.rotulada, table.rotulada tbody, table.rotulada tr { display: block; }
  table.rotulada thead { display: none; }
  table.rotulada tr { padding: 0.6rem 0.25rem; border-bottom: 1px solid var(--pico-muted-border-color); }
  table.rotulada td { display: block; padding: 0.1rem 0; border: 0; background: none; white-space: normal; }
  table.rotulada td[data-rotulo] { display: flex; justify-content: space-between; gap: 1rem; }
  table.rotulada td[data-rotulo]::before { content: attr(data-rotulo); color: var(--fc-mudo); text-align: left; }
  table.rotulada .c-acoes { padding-top: 0.4rem; }
  form.conferir { flex-wrap: wrap; }
  form.conferir input { flex: 1 1 7rem; }
}

/* Ritmo de vendas e formas de pagamento (ADRs 0034 e 0035): sem estilo inline (CSP) */
.periodo { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: flex-end; }
.periodo label { margin: 0; font-size: 0.875rem; }
.periodo input, .periodo button { margin: 0; padding: 0.35rem 0.6rem; width: auto; }
.navegacao [aria-current="true"] { pointer-events: none; }
.indices .c-barra { width: 40%; min-width: 6rem; }
.barra { display: block; height: 0.6rem; border-radius: 0.3rem; background: var(--pico-primary); }
.l-0 { width: 0%; }
.l-5 { width: 5%; }
.l-10 { width: 10%; }
.l-15 { width: 15%; }
.l-20 { width: 20%; }
.l-25 { width: 25%; }
.l-30 { width: 30%; }
.l-35 { width: 35%; }
.l-40 { width: 40%; }
.l-45 { width: 45%; }
.l-50 { width: 50%; }
.l-55 { width: 55%; }
.l-60 { width: 60%; }
.l-65 { width: 65%; }
.l-70 { width: 70%; }
.l-75 { width: 75%; }
.l-80 { width: 80%; }
.l-85 { width: 85%; }
.l-90 { width: 90%; }
.l-95 { width: 95%; }
.l-100 { width: 100%; }
.indice { display: inline-block; min-width: 3rem; padding: 0 0.35rem; border-radius: 0.3rem; text-align: right; }
.calor-1 { background: color-mix(in srgb, var(--fc-saida) 38%, transparent); }
.calor-2 { background: color-mix(in srgb, var(--fc-saida) 16%, transparent); }
.calor-4 { background: color-mix(in srgb, var(--fc-entrada) 18%, transparent); }
.calor-5 { background: color-mix(in srgb, var(--fc-entrada) 40%, transparent); }

.calor td small { display: block; font-size: 0.7rem; color: var(--fc-mudo); }
.pouco, .pouco td, td.pouco { color: var(--fc-mudo); font-style: italic; }
.pouco .barra { opacity: 0.4; }
/* pouco histórico: sem cor (o índice ainda não é confiável) */
.calor td.pouco, .indices .pouco .indice { background: none; }
.calor { table-layout: fixed; min-width: 34rem; }
.calor.calor-horas { min-width: 46rem; }
@media (max-width: 768px) { .indices .c-barra { display: none; } }
.calor th:first-child { width: 6.5rem; }
.calor td, .calor th { padding: 0.35rem 0.4rem; }
.menu nav a .rotulo { white-space: normal; line-height: 1.2; }
.medida a[role="button"] { width: auto; flex: none; padding: 0.3rem 0.9rem; font-size: 0.9rem; }
.calor-legenda { margin-top: 0.5rem; }
.duas-colunas { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); }
