/* =========================================================
   Fechamento de caixa (/ferramentas/fechamento-de-caixa/)
   Depende de /ferramentas/ferramentas.css (container, hero, calc,
   radios, prefixo, explica, cta-band).
   Impressão: body.fc-imp-fechamento mostra só #impresso;
   body.fc-imp-folha mostra só #folha-branca (A4, 2 turnos).
   ========================================================= */

.fc-opcional { color: var(--text-3); font-weight: 500; font-size: .92em; }

/* resumo no topo */
.fc-resumo { margin-top: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px 18px; }
.fc-resumo__titulo { margin: 0 0 8px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
.fc-resumo ul { margin: 0; padding-left: 18px; }
.fc-resumo li { font-size: 14.5px; line-height: 1.5; color: var(--text-2); margin-bottom: 6px; }

/* formulário */
.fc-form { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.fc-bloco { margin: 0; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.fc-bloco__titulo { float: left; width: 100%; padding: 0; margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: -0.015em; }
.fc-bloco__titulo + * { clear: both; }
.fc-bloco__ajuda { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.fc-num { width: 28px; height: 28px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); display: inline-grid; place-items: center; font-size: 14px; font-weight: 800; flex-shrink: 0; }
.fc-bloco .mc-field { margin: 0; min-width: 0; }
.fc-bloco .mc-input { font-size: 16px; min-height: 46px; width: 100%; box-sizing: border-box; } /* 16px: iOS não dá zoom */
.fc-bloco textarea.mc-input { min-height: 72px; padding-top: 10px; resize: vertical; }
.fc-grade2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.fc-cego { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: var(--surface-2); cursor: pointer; font-size: 14px; line-height: 1.45; color: var(--text-2); }
.fc-cego input { width: 20px; height: 20px; margin: 1px 0 0; flex-shrink: 0; accent-color: var(--brand); }
.fc-cego strong { color: var(--text); }

.fc-aviso { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: var(--radius-lg); background: var(--mc-amber-50); border: 1px solid var(--mc-amber-500); font-size: 14px; line-height: 1.45; color: var(--text); }
.fc-aviso svg { flex-shrink: 0; margin-top: 2px; }

/* listas (suprimentos, sangrias, despesas) */
.fc-lista-bloco { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--border); padding-top: 12px; }
.fc-lista__titulo { margin: 0; font-weight: 700; font-size: 14.5px; color: var(--text); }
.fc-lista { display: flex; flex-direction: column; gap: 8px; }
.fc-linha { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 11fr) 44px; gap: 8px; align-items: center; }
.fc-linha .mc-input { min-height: 44px; }
.fc-remover { width: 44px; height: 44px; border-radius: var(--radius-md, 10px); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font-size: 20px; line-height: 1; cursor: pointer; }
.fc-remover:hover { color: var(--danger, #b91c1c); border-color: currentColor; }
.fc-add { align-self: flex-start; }
.fc-lista__total { margin: 0; font-size: 13px; color: var(--text-3); }

/* contagem */
.fc-cedulas { width: 100%; border-collapse: collapse; font-size: 15px; }
.fc-cedulas th, .fc-cedulas td { padding: 4px 6px; text-align: left; }
.fc-cedulas thead th { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 700; }
.fc-cedulas tbody th[scope="row"] { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; width: 30%; }
.fc-cedulas td:nth-child(2) { width: 34%; }
.fc-cedulas .mc-input { min-height: 42px; text-align: center; font-family: var(--font-mono); padding: 0 6px; }
.fc-cedulas .fc-sub { font-family: var(--font-mono); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; color: var(--text-2); }
.fc-cedulas__grupo th { padding-top: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--brand); }
.fc-total-contado { margin: 0; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-lg); font-size: 15px; display: flex; justify-content: space-between; gap: 8px; }
.fc-total-contado b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 18px; }
.fc-confirmar { width: 100%; }
.fc-travada { display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border: 1px solid var(--mc-green-500); background: var(--mc-green-50, var(--surface-2)); border-radius: var(--radius-lg); }
.fc-travada p { margin: 0; font-size: 14px; }
.fc-travada .mc-btn { align-self: flex-start; }
.fc-bloco input:disabled { opacity: .75; }

/* cartão e Pix */
.fc-cartoes { display: flex; flex-direction: column; gap: 12px; }
.fc-cartao { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 12px; }
.fc-cartao__nome { margin: 0 0 8px; font-weight: 700; font-size: 14.5px; }
.fc-cartao__campos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fc-cartao__dif { margin: 8px 0 0; font-size: 13.5px; font-weight: 600; min-height: 1em; }
.fc-cartao__dif:empty { display: none; }

/* resultado */
.fc-resultado { position: sticky; top: 88px; } /* abaixo do nav fixo */
.fc-resultado .mc-card__body { display: flex; flex-direction: column; gap: 16px; }
#r-conteudo { display: flex; flex-direction: column; gap: 16px; }
.fc-escondido { display: flex; gap: 8px; align-items: center; margin: 0; padding: 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); color: var(--text-2); font-size: 14.5px; }
.fc-selo { border-radius: var(--radius-xl); padding: 18px 22px; background: var(--surface-2); border: 1px solid var(--border); }
.fc-selo__rotulo { margin: 0 0 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-3); }
.fc-selo__valor { margin: 0; font-family: var(--font-display); font-size: clamp(26px, 3.6vw, 38px); font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.fc-selo[data-status="bateu"] { background: var(--mc-green-50, #ecfdf5); border-color: var(--mc-green-500); }
.fc-selo[data-status="bateu"] .fc-selo__valor { color: var(--mc-green-700, #047857); }
.fc-selo[data-status="sobra"] { background: var(--mc-amber-50); border-color: var(--mc-amber-500); }
.fc-selo[data-status="sobra"] .fc-selo__valor { color: var(--mc-amber-700); }
.fc-selo[data-status="falta"] { background: var(--mc-red-50, #fef2f2); border-color: var(--mc-red-400); }
.fc-selo[data-status="falta"] .fc-selo__valor { color: var(--mc-red-700, #b91c1c); }
.fc-frase { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.fc-frase:empty { display: none; }

.fc-quadro { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.fc-quadro th { text-align: left; font-weight: 500; color: var(--text-2); padding: 5px 0; }
.fc-quadro td { text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; padding: 5px 0 5px 8px; }
.fc-quadro__total th, .fc-quadro__total td { font-weight: 700; color: var(--text); border-top: 1px solid var(--border); }

.fc-resultado h3 { margin: 0 0 8px; font-family: var(--font-display); font-size: 16px; font-weight: 700; }
.fc-procurar ul, .fc-cartoes-res ul { margin: 0; padding-left: 18px; }
.fc-procurar li, .fc-cartoes-res li { font-size: 14px; line-height: 1.5; color: var(--text-2); margin-bottom: 4px; }
.fc-procurar-cartao { margin-top: 8px; }
.fc-procurar-cartao summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--brand); }
.fc-procurar-cartao ul { margin-top: 8px; }
[data-status="falta"].fc-st { color: var(--mc-red-700, #b91c1c); }
[data-status="sobra"].fc-st { color: var(--mc-amber-700); }
[data-status="bateu"].fc-st { color: var(--mc-green-700, #047857); }

.fc-amanha p { margin: 0 0 4px; font-size: 14.5px; }
.fc-amanha b { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.fc-alerta { color: var(--mc-red-700, #b91c1c); font-weight: 600; }
.fc-sugestao { color: var(--text-2); font-size: 13.5px !important; line-height: 1.5; }

.fc-acoes { display: flex; flex-wrap: wrap; gap: 8px; border-top: 1px solid var(--border); padding-top: 16px; }
.fc-acoes .mc-btn--primary { flex: 1 1 100%; }
.fc-acoes .mc-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.fc-acoes button:disabled { opacity: .5; cursor: not-allowed; }
.fc-privacidade { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.fc-privacidade svg { flex-shrink: 0; margin-top: 2px; }

/* passo a passo */
.fc-passos { margin: 0 0 24px; padding-left: 22px; max-width: 72ch; }
.fc-passos li { margin-bottom: 8px; color: var(--text-2); line-height: 1.55; font-size: 15.5px; }
.fc-passos strong { color: var(--text); }

/* folha (texto) */
.fc-folha-info { padding: 8px 0 40px; max-width: 72ch; }
.fc-folha-info h2, .fc-faq h2 { font-family: var(--font-display); font-size: 28px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 10px; }
.fc-folha-info p { color: var(--text-2); line-height: 1.6; margin: 0 0 16px; }
.fc-folha-info .mc-btn { display: inline-flex; align-items: center; gap: 8px; }

/* FAQ */
.fc-faq { padding: 8px 0 56px; max-width: 80ch; }
.fc-faq details { border-top: 1px solid var(--border); padding: 16px 0; }
.fc-faq details:last-child { border-bottom: 1px solid var(--border); }
.fc-faq summary { cursor: pointer; font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--text); }
.fc-faq p { margin: 10px 0 0; font-size: 15.5px; line-height: 1.65; color: var(--text-2); }

/* CTA */
.fc-cta-ressalva { font-size: 14px !important; opacity: .85 !important; }
.fc-ctas { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.fc-ctas .mc-btn { display: inline-flex; align-items: center; gap: 8px; }
.cta-band a.mc-btn.mc-btn--secondary.fc-btn-wapp { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }

/* blocos só de impressão: fora da tela */
.fc-impresso, .fc-folha { display: none; }

/* === RESPONSIVO === */
@media (max-width: 900px) {
  .fc-resultado { position: static; }
}
@media (max-width: 720px) {
  .fc-bloco { padding: 16px; }
  .fc-linha { grid-template-columns: minmax(0, 1fr) 44px; }
  .fc-linha .fc-linha__desc { grid-column: 1 / 2; grid-row: 2; }
  .fc-linha .fc-remover { grid-row: 1 / 3; grid-column: 2; align-self: start; }
  .fc-ctas .mc-btn { width: 100%; justify-content: center; }
  .fc-folha-info h2, .fc-faq h2 { font-size: 23px; }
}
@media (max-width: 380px) {
  .fc-grade2, .fc-cartao__campos { grid-template-columns: 1fr; }
}

/* =========================================================
   IMPRESSÃO
   ========================================================= */
@media print {
  @page { size: A4; margin: 10mm; }
  body { background: #fff !important; color: #000; }
  body.fc-imp-fechamento > *:not(#impresso),
  body.fc-imp-folha > *:not(#folha-branca) { display: none !important; }
  body.fc-imp-fechamento #impresso { display: block; }
  body.fc-imp-folha #folha-branca { display: block; }

  /* fechamento preenchido */
  .fc-impresso { font-family: Arial, Helvetica, sans-serif; font-size: 10.5pt; color: #000; }
  .fc-impresso h2 { font-size: 15pt; margin: 0 0 2mm; }
  .fc-impresso h3 { font-size: 11pt; margin: 4mm 0 1.5mm; border-bottom: 1px solid #000; padding-bottom: 1mm; }
  .fc-impresso p { margin: 0 0 1.5mm; overflow-wrap: anywhere; }
  .fc-impresso table { width: 100%; border-collapse: collapse; }
  .fc-impresso th, .fc-impresso td { border: 1px solid #999; padding: 1mm 2mm; text-align: left; font-size: 10pt; }
  .fc-impresso td.num { text-align: right; font-family: "Courier New", monospace; white-space: nowrap; }
  .fc-impresso .imp-colunas { display: grid; grid-template-columns: 1fr 1fr; gap: 6mm; }
  .fc-impresso .imp-resultado { font-size: 14pt; font-weight: 700; border: 2px solid #000; padding: 2mm 3mm; margin: 3mm 0; }
  .fc-impresso .imp-aviso { font-weight: 700; }
  .fc-impresso .imp-assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 12mm; margin-top: 14mm; }
  .fc-impresso .imp-assinaturas p { border-top: 1px solid #000; padding-top: 1mm; text-align: center; }
  .fc-impresso .imp-rodape { margin-top: 5mm; font-size: 8pt; color: #555; }
  .fc-impresso ul { margin: 0; padding-left: 5mm; }

  /* folha em branco: 2 turnos por A4 */
  .fc-folha { font-family: Arial, Helvetica, sans-serif; color: #000; font-size: 8.5pt; }
  .fc-folha__turno { height: 129mm; box-sizing: border-box; border: 1px solid #000; padding: 3mm 4mm; margin-bottom: 3mm; display: flex; flex-direction: column; break-inside: avoid; page-break-inside: avoid; }
  .fc-folha__topo { display: flex; flex-direction: column; gap: 1mm; margin-bottom: 2mm; }
  .fc-folha__titulo { margin: 0; font-size: 12pt; font-weight: 700; }
  .fc-folha__campos { margin: 0; }
  .fc-folha__colunas { display: grid; grid-template-columns: 1.25fr 1fr; gap: 4mm; flex: 1; }
  .fc-folha__tabela { width: 100%; border-collapse: collapse; margin-bottom: 1.5mm; }
  .fc-folha__tabela th, .fc-folha__tabela td { border: 1px solid #777; padding: 0.6mm 1.5mm; text-align: left; font-weight: 400; height: 4.4mm; }
  .fc-folha__tabela td { width: 28%; }
  .fc-folha__cartao td { width: 22%; }
  .fc-folha__contagem td { width: 30%; }
  .fc-folha__forte th, .fc-folha__forte td { font-weight: 700; }
  .fc-folha__mini { margin: 1mm 0; }
  .fc-folha__linha { margin: 0; height: 4.6mm; border-bottom: 1px solid #999; }
  .fc-folha__assinaturas { display: grid; grid-template-columns: 1fr 1fr; gap: 10mm; margin-top: 7mm; }
  .fc-folha__assinaturas p { margin: 0; border-top: 1px solid #000; padding-top: 0.8mm; text-align: center; }
  .fc-folha__rodape { margin: 0; font-size: 7pt; color: #555; text-align: center; }
}
