* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #1c2430; background: #eef1f5; }
main { padding: 16px; }
a { color: #1d5fa8; }
h1 { font-size: 18px; margin: 0 0 8px; }
h2 { font-size: 15px; margin: 20px 0 4px; }

.barra { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; padding: 10px 16px; background: #1c2f4a; color: #fff; }
.barra a { color: #cfe1f7; text-decoration: none; }
.barra a:hover { text-decoration: underline; }
.barra .quem { margin-left: auto; font-size: 13px; }
.aviso { margin: 12px 16px 0; padding: 8px 12px; background: #fff7d6; border: 1px solid #e6cf7a; border-radius: 4px; }
.erro { padding: 8px 12px; background: #fde4e1; border: 1px solid #e3a199; border-radius: 4px; }
.dica { color: #5a6676; font-size: 12.5px; margin: 2px 0 8px; }

.cartao { background: #fff; border: 1px solid #d5dbe3; border-radius: 6px; padding: 18px; max-width: 980px; margin: 0 auto; }
.login { max-width: 340px; margin-top: 8vh; display: grid; gap: 12px; }
.login label { display: grid; gap: 4px; font-size: 13px; }

input, select, button { font: inherit; padding: 6px 8px; border: 1px solid #b4bcc8; border-radius: 4px; background: #fff; }
input[type=checkbox] { padding: 0; }
button { cursor: pointer; background: #f1f3f6; }
button.primario { background: #1d5fa8; border-color: #1d5fa8; color: #fff; }
button.perigo { color: #a32020; }
.largo { width: 100%; min-width: 180px; }

.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; max-width: 210mm; margin: 0 auto 14px; }
.filtros label { display: grid; gap: 3px; font-size: 12px; color: #4a5565; }

.edicao { width: 100%; border-collapse: collapse; margin: 6px 0 12px; }
.edicao th, .edicao td { padding: 5px 6px; border-bottom: 1px solid #e3e7ec; text-align: left; vertical-align: middle; }
.edicao th { font-size: 12px; color: #4a5565; }
.edicao tr.nova td { background: #f6f9fc; }
.excluindo { opacity: .45; text-decoration: line-through; }
.emlinha { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.emlinha.novo { margin: 4px 0 10px; }
.emlinha .largo { flex: 1; width: auto; }
.linha-obs { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 8px; border: 1px solid #e3e7ec; border-radius: 4px; margin-bottom: 8px; }
.linha-obs.nova { background: #f6f9fc; }
.linha-obs .largo { flex: 1 1 260px; width: auto; }
.marca { font-size: 13px; white-space: nowrap; }
.navdia { display: flex; gap: 14px; align-items: center; font-size: 16px; }
.navdia a { text-decoration: none; }

/* ---------------- Folha A4 ---------------- */
.folha { width: 210mm; max-width: 100%; margin: 0 auto 18px; padding: 8mm; background: #fff; border: 1px solid #cfd5dd;
         display: flex; flex-direction: column; font-size: 7.6pt; color: #000; }
.folha header { display: flex; justify-content: space-between; gap: 6mm; border-bottom: 1.5px solid #000; padding-bottom: 1.5mm; margin-bottom: 1.5mm; }
.folha header h1 { font-size: 12pt; margin: 0 0 1mm; }
.folha header p { margin: 0; }
.folha header dl { margin: 0; display: grid; grid-template-columns: auto auto; gap: 0 5mm; }
.folha header dl div { display: flex; gap: 1.5mm; }
.folha header dt { font-weight: bold; }
.folha header dd { margin: 0; }
.rolagem { overflow-x: auto; }

.ponto, .resumo { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ponto th, .ponto td { border: 0.5px solid #777; padding: 0.55mm 0.8mm; text-align: center; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ponto th { background: #e6e6e6; font-size: 7pt; width: 6.3%; }
.ponto th:first-child { width: 7%; }
.ponto th.obs { width: auto; }
.ponto td.obs { text-align: left; font-size: 6.8pt; }
.ponto td.dia { text-align: left; font-weight: bold; }
.ponto td.dia small { font-weight: normal; }
.ponto tr.dsr td, .ponto tr.feriado td, .ponto tr.compensado td, .ponto tr.fora td, .ponto tr.afastado td { background: #f0f0f0; }
.ponto tr.falta td.obs { font-weight: bold; }
.ponto th.no-print, .ponto td.no-print { width: 26px; border: 0; background: none !important; }
.editar { text-decoration: none; font-size: 13px; }

.resumo { margin-top: 2mm; }
.resumo caption { text-align: left; font-weight: bold; font-size: 8.5pt; padding-bottom: 0.8mm; }
.resumo th, .resumo td { border: 0.5px solid #777; padding: 0.7mm 1mm; line-height: 1.15; }
.resumo th { text-align: left; font-weight: normal; background: #f0f0f0; width: 15%; }
.resumo td { text-align: right; width: 10%; white-space: nowrap; }
.resumo td.forte { font-weight: bold; }
.resumo td.forte small { font-weight: normal; }
.resumo td.legenda { text-align: left; white-space: normal; font-size: 6.5pt; color: #333; }

.folha footer { margin-top: auto; padding-top: 4mm; }
.folha footer p { margin: 0 0 10mm; font-size: 7.5pt; }
.assinaturas { display: flex; gap: 8mm; text-align: center; }
.assinaturas div { flex: 1; }
.assinaturas div.data { flex: 0 0 32mm; }
.assinaturas span { display: block; border-top: 0.8px solid #000; margin-bottom: 1mm; }

@page { size: A4 portrait; margin: 0; }

@media print {
  html, body { background: #fff; }
  main { padding: 0; }
  .no-print { display: none !important; }
  .rolagem { overflow: visible; }
  .folha { width: 210mm; height: 296.5mm; max-width: none; margin: 0; border: 0; padding: 9mm 9mm 10mm;
           overflow: hidden; break-after: page; page-break-after: always; break-inside: avoid; }
  .folha:last-of-type { break-after: auto; page-break-after: auto; }
  .ponto tr.dsr td, .ponto tr.feriado td, .ponto tr.compensado td, .ponto tr.fora td, .ponto tr.afastado td,
  .ponto th, .resumo th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media screen and (max-width: 820px) {
  .ponto { min-width: 190mm; }
  .resumo, .resumo tbody, .resumo tr { display: block; }
  .resumo tr { display: grid; grid-template-columns: 1fr auto; }
  .resumo th, .resumo td { width: auto; }
  .resumo td.legenda { grid-column: 1 / -1; }
}
