/* ERP Tibasoy: colours and shapes from the approved phone mockup
   (docs/superpowers/specs/2026-10-16-erp-web-reports-mockup.html, option B). */

:root {
  --verde: #1f5f3f;
  --verde-claro: #eef5f0;
  --texto: #1a1a1a;
  --texto-suave: #555;
  --fundo: #fafafa;
  --borda: #cfcfcf;
  --borda-clara: #e3e3e3;
  --linha: #e5e5e5;
  --pill: #e8e8e8;
  --erro: #a11;
  --erro-fundo: #fde0e0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 15px/1.4 -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;
}

/* Header bar */
.bar {
  background: var(--verde);
  color: #fff;
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-weight: 600;
}
.bar-titulo { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.bar .marca { color: inherit; text-decoration: none; white-space: nowrap; }
.bar .titulo {
  font-weight: 400;
  opacity: .85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bar .sair { margin: 0; flex: none; }
.bar .sair button {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 8px;
  padding: 5px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
}

main { padding: 16px; max-width: 1280px; margin: 0 auto; }
h1 { font-size: 20px; margin: 0 0 16px; }

/* Form fields */
.fld { margin-bottom: 14px; border: 0; padding: 0; min-width: 0; }
.fld > label:not(.chk), .fld > legend {
  display: block;
  font-size: 12px;
  color: var(--texto-suave);
  margin-bottom: 4px;
  padding: 0;
  text-transform: uppercase;
  letter-spacing: .03em;
}
input[type="text"], input[type="password"], input[type="date"], select {
  width: 100%;
  border: 1px solid var(--borda);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  color: var(--texto);
  font: inherit;
  font-size: 16px; /* 16px keeps iOS from zooming in on focus */
}
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--verde);
  outline-offset: 2px;
}
.bar :focus-visible { outline-color: #fff; }
.row2 { display: flex; gap: 10px; }
.row2 > .fld { flex: 1; }

/* Buttons */
.btn {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 13px;
  background: var(--verde);
  color: #fff;
  border: 2px solid var(--verde);
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.btn-sec { background: #fff; color: var(--verde); }

/* Messages */
.erro { color: var(--erro); font-size: 13px; margin: 4px 0 0; }
.erro.aviso {
  background: var(--erro-fundo);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 14px;
  font-size: 14px;
}

/* Login */
.entrar {
  max-width: 360px;
  margin: 0 auto;
  min-height: calc(100vh - 140px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.marca-grande { text-align: center; margin-bottom: 30px; }
.marca-grande .nome { font-size: 28px; font-weight: 700; color: var(--verde); }
.marca-grande .sub { color: #666; }

/* Error page */
.erro-pagina { max-width: 360px; margin: 48px auto; text-align: center; }
.erro-pagina .codigo { color: var(--texto-suave); font-size: 13px; margin: 0 0 8px; }

/* Report list */
.relatorios { list-style: none; margin: 0; padding: 0; }
.relatorios a {
  display: block;
  background: #fff;
  border: 1px solid var(--borda-clara);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  color: var(--verde);
  font-weight: 600;
  text-decoration: none;
}

/* Filter form */
.filtros { max-width: 560px; }
.opcional { text-transform: none; letter-spacing: 0; color: #999; }
.chk, .opc { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.chk { padding: 8px 0; border-bottom: 1px solid #eee; }
div.fld > .chk { border-bottom: 0; }
.chk input, .opc input { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--verde); }
.opcoes { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 4px 0; }
.opc { padding: 6px 0; }
details > summary { color: var(--verde); font-size: 13px; padding: 8px 0; cursor: pointer; }
.atalhos { margin-top: -4px; margin-bottom: 14px; }
.pills > button {
  border: 0;
  color: var(--texto);
  font: inherit;
  font-size: 13px;
  padding: 6px 12px;
  cursor: pointer;
}

/* Report pages: filter pills, totals block, result table */
.voltar {
  display: inline-block;
  color: var(--verde);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  padding: 2px 0;
  margin-bottom: 10px;
}
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pills > * { background: var(--pill); border-radius: 14px; padding: 4px 10px; font-size: 12px; }
.totais {
  background: var(--verde-claro);
  border-radius: 10px;
  padding: 8px 6px;
  margin-bottom: 12px;
  overflow-x: auto;
}
/* Groups as columns, measures as lines: at 11px three 14-character sums
   ("134.931.807,50") and the labels fit 390px phones. */
.totais table { width: 100%; border-collapse: collapse; font-size: 11px; white-space: nowrap; }
.totais th, .totais td { padding: 4px 4px; text-align: left; }
.totais thead th { font-size: 11px; font-weight: 400; color: #444; }
.totais tbody th { font-weight: 600; }
.totais .saldo { border-left: 1px solid rgba(31, 95, 63, .25); font-weight: 700; }
.exportar { margin: 0 0 12px; }
.aviso-info {
  background: #fff4d6;
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
  font-size: 13px;
}
.scrollhint { font-size: 11px; color: #777; text-align: right; margin: 0 0 4px; }
.table-wrap {
  /* Sideways scroll on phones. The page does the vertical scrolling (no nested
     scroller); resultado.js keeps the header row in view. */
  overflow-x: auto;
  border: 1px solid var(--borda-clara);
  border-radius: 8px;
  background: #fff;
}
.table-wrap table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.table-wrap th, .table-wrap td { padding: 6px 8px; border-bottom: 1px solid var(--linha); text-align: left; }
.table-wrap th { background: var(--verde-claro); position: relative; z-index: 1; }
th.n, td.n { text-align: right; font-variant-numeric: tabular-nums; }
tr.canc td { color: var(--erro); text-decoration: line-through; }
.vazio { text-align: center; color: var(--texto-suave); padding: 24px 0; margin: 0; }
.rodape { text-align: center; color: #777; font-size: 12px; padding: 8px; margin: 0; }

@media (min-width: 768px) {
  .table-wrap table { font-size: 13px; }
  .exportar { display: inline-block; width: auto; padding: 10px 20px; }
  .totais table { width: auto; font-size: 12px; }
  .totais th, .totais td { padding: 4px 12px; }
}
