[hidden] { display: none !important; }
:root {
  --azul: #0b5c8a; --azul-esc: #084466; --verde: #1f8a4c; --amarelo: #b7791f; --vermelho: #c0392b;
  --cinza: #6b7280; --borda: #e2e5ea; --fundo: #f4f6f8; --card: #fff; --texto: #1f2937;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif; background: var(--fundo); color: var(--texto); font-size: 14px; }
header { display: flex; align-items: center; gap: 24px; background: var(--azul-esc); color: #fff; padding: 0 20px; height: 54px; flex-wrap: wrap; }
.marca { font-weight: 700; font-size: 16px; }
.marca small { background: #ffffff22; padding: 2px 6px; border-radius: 4px; font-size: 11px; margin-left: 4px; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { color: #cfe3f0; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
nav a.ativo, nav a:hover { background: #ffffff1a; color: #fff; }
.usuario { font-size: 13px; }
.usuario .link { color: #cfe3f0; }
main { max-width: 1200px; margin: 0 auto; padding: 20px; }
h1 { font-size: 22px; margin: 4px 0 16px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.aviso { background: #fff7e0; border-bottom: 1px solid #f1d58a; padding: 8px 20px; font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--borda); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.linha { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px; }
.kpi b { display: block; font-size: 28px; }
.kpi span { color: var(--cinza); font-size: 13px; }
.kpi.alerta b { color: var(--vermelho); } .kpi.atencao b { color: var(--amarelo); } .kpi.bom b { color: var(--verde); }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--borda); vertical-align: middle; }
th { font-size: 12px; color: var(--cinza); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
tr.sub td:first-child { padding-left: 28px; }
tr.sub td:first-child::before { content: "↳ "; color: var(--cinza); }
tr.clicavel { cursor: pointer; } tr.clicavel:hover { background: #f8fafc; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: #e3f4ea; color: var(--verde); }
.tag.a_vencer { background: #fdf3e1; color: var(--amarelo); }
.tag.vencido, .tag.faltando { background: #fbe7e5; color: var(--vermelho); }
.tag.neutro { background: #eef0f3; color: var(--cinza); }
.tag.opcional { background: #eef0f3; color: var(--cinza); }
button, .btn { font: inherit; border: 1px solid var(--borda); background: #fff; color: var(--texto); padding: 7px 12px; border-radius: 7px; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover, .btn:hover { background: #f3f4f6; }
button.prim, .btn.prim { background: var(--azul); border-color: var(--azul); color: #fff; }
button.prim:hover { background: var(--azul-esc); }
button.verde { background: var(--verde); border-color: var(--verde); color: #fff; }
button.perigo { color: var(--vermelho); }
button.link { border: 0; background: none; padding: 0; color: var(--azul); text-decoration: underline; }
button.peq, .btn.peq { padding: 4px 9px; font-size: 13px; }
button:disabled { opacity: .5; cursor: not-allowed; }
form .campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 16px; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--cinza); font-weight: 600; }
label.chk { flex-direction: row; align-items: center; gap: 8px; color: var(--texto); font-weight: 400; font-size: 14px; }
input, select, textarea { font: inherit; padding: 8px 10px; border: 1px solid #cfd4db; border-radius: 7px; color: var(--texto); background: #fff; font-weight: 400; }
textarea { min-height: 80px; resize: vertical; }
.full { grid-column: 1 / -1; }
fieldset { border: 1px solid var(--borda); border-radius: 8px; padding: 12px 14px; margin: 0 0 14px; }
legend { font-weight: 600; padding: 0 6px; }
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--borda); margin-bottom: 16px; flex-wrap: wrap; }
.abas button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 10px 14px; color: var(--cinza); }
.abas button.ativo { border-color: var(--azul); color: var(--azul); font-weight: 600; }
.muted { color: var(--cinza); }
.pend { color: var(--vermelho); font-size: 13px; margin: 4px 0 0; padding-left: 18px; }
.modal { position: fixed; inset: 0; background: #0008; display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; z-index: 10; }
.modal .caixa { background: #fff; border-radius: 12px; padding: 20px; width: 100%; max-width: 640px; }
.modal .acoes { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#toast { position: fixed; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 20; }
#toast div { background: #1f2937; color: #fff; padding: 10px 14px; border-radius: 8px; max-width: 380px; box-shadow: 0 4px 12px #0003; }
#toast div.erro { background: var(--vermelho); }
.login { max-width: 360px; margin: 80px auto; }
.previa { white-space: pre-wrap; background: #f8fafc; border: 1px solid var(--borda); border-radius: 8px; padding: 12px; font-size: 13px; max-height: 300px; overflow: auto; }
.vazio { text-align: center; color: var(--cinza); padding: 24px; }
@media (max-width: 700px) {
  header { height: auto; padding: 10px 16px; gap: 8px; }
  nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  main { padding: 16px; }
  .tabela-wrap { overflow-x: auto; }
}

/* passo a passo da empresa */
.passos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 14px; }
.passo { display: flex; gap: 10px; align-items: center; text-align: left; padding: 10px 12px; border-radius: 10px; background: #fff; border: 1px solid var(--borda); }
.passo .num { flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: #eef0f3; color: var(--cinza); }
.passo small { color: var(--cinza); }
.passo.feito .num { background: var(--verde); color: #fff; }
.passo.atual { border-color: var(--azul); box-shadow: 0 0 0 2px #0b5c8a22; }
.passo.atual .num { background: var(--azul); color: #fff; }
.dica { background: #eaf3f9; border-left: 4px solid var(--azul); padding: 8px 12px; border-radius: 6px; margin: 10px 0 0; }
.card.destaque { border-color: var(--azul); background: #f5fafd; }
.menu-wrap { position: relative; }
.menu { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--borda); border-radius: 8px; box-shadow: 0 6px 20px #0002; z-index: 5; min-width: 260px; }
.menu a { display: block; padding: 10px 14px; color: var(--texto); text-decoration: none; }
.menu a:hover { background: #f3f4f6; }
@media (max-width: 700px) { .passos { grid-template-columns: 1fr 1fr; } }

/* ===== v2: lançamento rápido ===== */
h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--cinza); margin: 18px 0 8px; }
.rot { display: block; font-size: 12px; color: var(--cinza); font-weight: 600; margin-bottom: 6px; }
.campos.uma { grid-template-columns: 1fr; }
.peq-txt { font-size: 12px; }
.mini { display: inline-block; font-size: 11px; background: #eef3f7; color: #355; padding: 1px 7px; border-radius: 4px; margin: 1px 0; }
.nr { font-size: 11px; color: var(--azul); background: #e8f1f8; padding: 1px 6px; border-radius: 4px; font-weight: 600; }
a.kpi { text-decoration: none; color: inherit; }
.kpi small { font-size: 16px; color: var(--cinza); font-weight: 500; }
.kpis { margin-bottom: 16px; }
.duas { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; align-items: start; }
.lista-item { display: flex; justify-content: space-between; gap: 8px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--borda); color: inherit; text-decoration: none; flex-wrap: wrap; }
.lista-item:hover { background: #f8fafc; }
.passos-lista { margin: 0; padding-left: 20px; line-height: 1.9; }
details summary { cursor: pointer; font-weight: 600; color: var(--azul); margin-top: 16px; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border-radius: 999px; padding: 6px 12px; font-size: 13px; background: #fff; border: 1px solid #cfd4db; }
.chip.on { background: var(--azul); border-color: var(--azul); color: #fff; }
.chip.on::before { content: "✓ "; }

/* segmentado Sim/Não */
.seg { display: inline-flex; border: 1px solid #cfd4db; border-radius: 8px; overflow: hidden; flex: none; }
.seg button { border: 0; border-radius: 0; padding: 8px 16px; background: #fff; font-weight: 600; color: var(--cinza); }
.seg button + button { border-left: 1px solid #cfd4db; }
.seg button.on { background: #6b7280; color: #fff; }
.seg button.on.sim { background: var(--verde); }
.seg button.on.nao { background: var(--vermelho); }
.seg.peq button { padding: 4px 12px; font-size: 13px; }

/* itens */
.item { border: 1px solid var(--borda); border-left: 4px solid var(--verde); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: #fff; }
.item.pendente { border-left-color: var(--vermelho); }
.item-cab { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.item-corpo { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-top: 8px; position: relative; }
.item-sim { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; flex: 1; }
.item-sim label.data { width: 200px; white-space: nowrap; }
.pergunta { display: flex; align-items: center; gap: 10px; font-size: 13px; background: #f8fafc; padding: 6px 10px; border-radius: 8px; }
.pergunta.col { flex-direction: column; align-items: flex-start; }
.item-motivo { flex-basis: 100%; color: var(--vermelho); font-size: 12px; }
.item-motivo:empty { display: none; }
.anexo { font-size: 12px; }
.link-anexo { display: inline; color: var(--azul); cursor: pointer; font-weight: 400; font-size: 12px; text-decoration: underline; }
.salvo { position: absolute; right: 0; bottom: 0; color: var(--verde); font-size: 12px; }
.condicoes { display: flex; flex-wrap: wrap; gap: 20px; background: #f8fafc; border-radius: 8px; padding: 10px 12px; margin: 12px 0; }

/* controle mensal */
table.mensal td { padding: 6px; }
.cel { width: 100%; min-height: 40px; background: #fff; color: var(--cinza); }
.cel.recebido { background: #e3f4ea; border-color: #b9e2c9; color: var(--verde); font-weight: 600; }
.cel.atrasado { background: #fbe7e5; border-color: #f2c2bc; color: var(--vermelho); font-weight: 600; }

.lista-check { max-height: 260px; overflow: auto; border: 1px solid var(--borda); border-radius: 8px; padding: 6px 10px; }
.lista-check label { padding: 4px 0; }
.modal .caixa.larga { max-width: 760px; }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cfd4db; border-radius: 22px; cursor: pointer; transition: .15s; }
.switch span::before { content: ""; position: absolute; width: 16px; height: 16px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .15s; }
.switch input:checked + span { background: var(--verde); }
.switch input:checked + span::before { transform: translateX(18px); }
.abas { margin-top: 14px; }
@media (max-width: 900px) { .duas { grid-template-columns: 1fr; } }
@media (max-width: 700px) { .item-sim label.data { width: 100%; } .item-cab { flex-direction: column; } }

nav a { white-space: nowrap; }

/* ===== Dashboard ===== */
:root { --st-good: #0ca30c; --st-warning: #fab219; --st-serious: #ec835a; --st-critical: #d03b3b; --serie: #2a78d6; --trilho: #eef0f3; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.tile { background: var(--card); border: 1px solid var(--borda); border-radius: 10px; padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; position: relative; }
.tile-rot { font-size: 13px; color: var(--cinza); }
.tile-val { font-size: 30px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }
.tile-val small { font-size: 16px; color: var(--cinza); font-weight: 500; }
.tile-sub { font-size: 12px; color: var(--cinza); }
.tile.warning, .tile.serious, .tile.critical { border-left: 4px solid; }
.tile.warning { border-left-color: var(--st-warning); } .tile.serious { border-left-color: var(--st-serious); } .tile.critical { border-left-color: var(--st-critical); }
a.tile:hover { border-color: var(--azul); }
.duas-iguais { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
/* barra empilhada */
.stack { display: flex; gap: 2px; height: 20px; margin: 4px 0 12px; }
.stack-rot { display: flex; justify-content: space-between; font-size: 13px; font-weight: 600; }
.stack-rot .muted { font-weight: 400; }
.seg-bar { min-width: 4px; cursor: default; }
.seg-bar:first-child { border-radius: 4px 0 0 4px; } .seg-bar:last-child { border-radius: 0 4px 4px 0; } .seg-bar:only-child { border-radius: 4px; }
.seg-bar:hover, .seg-bar:focus { filter: brightness(1.1); outline: none; }
.legenda { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 16px; }
.leg-item { display: grid; grid-template-columns: 12px 16px 1fr auto 40px; gap: 6px; align-items: center; font-size: 13px; }
.leg-item b { font-variant-numeric: tabular-nums; }
.leg-item .muted { text-align: right; font-size: 12px; }
.sw { width: 12px; height: 12px; border-radius: 3px; }
.leg-ic { color: var(--cinza); text-align: center; font-weight: 700; }
/* colunas por mês */
.colunas { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 0 4px; border-bottom: 1px solid var(--borda); margin-top: 8px; }
.col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; position: relative; outline: none; padding-bottom: 0; }
.col-bar { width: 100%; max-width: 24px; background: var(--serie); border-radius: 4px 4px 0 0; }
.col:hover .col-bar, .col:focus .col-bar { filter: brightness(1.15); }
.col-val { font-size: 12px; font-weight: 600; margin-bottom: 4px; font-variant-numeric: tabular-nums; }
.col-rot { position: absolute; bottom: -22px; font-size: 12px; color: var(--cinza); white-space: nowrap; }
.colunas + * { margin-top: 28px; }
.card:has(.colunas) { padding-bottom: 36px; }
/* barras horizontais */
.barras { display: flex; flex-direction: column; gap: 8px; }
.barra { display: grid; grid-template-columns: minmax(120px, 58%) 1fr 32px; gap: 10px; align-items: center; font-size: 13px; outline: none; }
.barra-rot { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.barra-trilho { height: 14px; display: block; }
.barra-trilho span { display: block; height: 100%; min-width: 2px; background: var(--serie); border-radius: 0 4px 4px 0; }
.barra:hover .barra-trilho span, .barra:focus .barra-trilho span { filter: brightness(1.15); }
.barra b { text-align: right; font-variant-numeric: tabular-nums; }
/* medidor de conformidade */
.meter { display: inline-block; width: calc(100% - 46px); height: 10px; background: var(--trilho); border-radius: 4px; vertical-align: middle; outline: none; }
.meter span { display: block; height: 100%; background: var(--serie); border-radius: 4px; }
.meter-val { display: inline-block; width: 42px; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; font-size: 13px; }
/* tooltip */
#tip { position: fixed; display: none; z-index: 50; pointer-events: none; background: #1f2937; color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 12px; box-shadow: 0 4px 12px #0003; max-width: 280px; }
#tip b { display: block; font-size: 14px; }
#tip span { color: #cbd5e1; }
@media (max-width: 900px) { .duas-iguais { grid-template-columns: 1fr; } .legenda { grid-template-columns: 1fr; } }

.tile-val { font-size: 28px; }

.duas > *, .duas-iguais > * { min-width: 0; }
.tabela-wrap { overflow-x: auto; }

/* ===== Inspeções ===== */
.ici-fixo { position: sticky; top: 0; z-index: 4; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; background: #fff; border: 1px solid var(--borda); border-radius: 10px; padding: 10px 16px; margin-bottom: 12px; box-shadow: 0 2px 8px #0000000d; }
.ici-fixo b { font-size: 22px; }
.q { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--borda); flex-wrap: wrap; }
.q:last-child { border-bottom: 0; }
.q-txt { flex: 1 1 380px; font-size: 14px; }
.q-resp { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; flex: 0 0 auto; }
.q-obs { width: 330px; max-width: 100%; font-size: 13px; padding: 6px 8px; }
.q.q-nc { background: #fdf3f2; } .q.q-ins { background: #fffaf0; }
.seg button.on.ins { background: #d69e2e; }
.seg button { padding: 8px 12px; }
.faixa { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.fx-a { background: #e3f4ea; color: #146c2e; } .fx-b { background: #e6f0fb; color: #1c5cab; } .fx-c { background: #fdf3e1; color: #8a5a00; } .fx-d { background: #fbe7e5; color: #a12622; }
.nota { padding: 2px 8px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.sobe { color: var(--verde); font-weight: 600; } .desce { color: var(--vermelho); font-weight: 600; }
table.heat th { font-size: 11px; text-transform: none; letter-spacing: 0; max-width: 110px; }
table.heat td.hc { text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; border: 2px solid #fff; border-radius: 6px; cursor: default; }
.barra-trilho.duplo { display: flex; gap: 2px; }
.barra-trilho.duplo span { border-radius: 0; }
.barra-trilho.duplo span:last-child { border-radius: 0 4px 4px 0; }
.legenda-linha { display: flex; gap: 16px; font-size: 12px; margin: 0 0 10px; }
.legenda-linha .sw { display: inline-block; vertical-align: -1px; margin-right: 4px; }
table.rel td { padding: 7px 6px; }
.obs { margin-top: 4px; font-size: 13px; background: #f8fafc; padding: 4px 8px; border-radius: 6px; }
@media (max-width: 700px) { .q-resp { align-items: stretch; width: 100%; } .q-resp .seg { display: flex; } .q-resp .seg button { flex: 1; padding: 10px 4px; } .q-obs { width: 100%; } }
@media print {
  header, #avisoSmtp, .nao-imprimir, #toast, .chips { display: none !important; }
  body { background: #fff; } main { max-width: none; padding: 0; }
  .card { break-inside: avoid; border: 1px solid #ccc; }
  .duas, .duas-iguais { grid-template-columns: 1fr 1fr; }
}

.q-resp-emp { max-width: 420px; }
.q-resp-emp .chips { margin-top: 4px; }
.q-resp-emp .chip { padding: 3px 10px; font-size: 12px; }
