/* Inspeções SMS e 5S — estilos do aplicativo.
   As cores da marca ficam em /brand/theme.css (carregado depois deste arquivo). */
:root {
  color-scheme: light;
  --brand: #4a0a17; --brand-deep: #24050c; --brand-ink: #fff; --accent: #9a142d; --accent-dark: #7c0f23; --accent-ink: #fff; --hl: #ffb3bf;
  --bg: #f4f4f1; --card: #fff; --ink: #14171a; --mut: #5d646c; --line: #dfe1e3; --soft: #f0f1ef;
  --red: #c8231a; --amb: #b77900; --ok: #0b7c70;
  --navh: 64px;
}
* { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 'Nunito Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; overflow-x: clip; }
body.modal-aberto { overflow: hidden; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0 0 8px; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; background: var(--card); border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; width: 100%; min-height: 44px; }
input[readonly], textarea[readonly] { background: var(--soft); }
textarea { min-height: 76px; resize: vertical; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label, .lbl { display: block; font-size: 13px; font-weight: 600; color: var(--mut); margin-bottom: 4px; }
a { color: inherit; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; }

/* utilitários */
.muted { color: var(--mut); } .small { font-size: 13px; } .red { color: var(--red); } .ok { color: var(--ok); } .b { font-weight: 700; }
.mt4 { margin-top: 4px; } .mt6 { margin-top: 6px; } .mt8 { margin-top: 8px; } .mt10 { margin-top: 10px; } .mt12 { margin-top: 12px; } .mt14 { margin-top: 14px; } .mt16 { margin-top: 16px; }

/* botões */
.btn { min-height: 44px; padding: 10px 16px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.btn.pri { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.pri:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn.dng { color: var(--red); }
.btn.ghost { background: transparent; border-color: rgba(255,255,255,.35); color: var(--brand-ink); }
.btn:disabled { opacity: .5; cursor: default; }

/* cabeçalho e navegação */
header {
  position: relative; color: var(--brand-ink); padding-top: env(safe-area-inset-top);
  background:
    radial-gradient(ellipse at 10% 0%, rgba(154, 20, 45, .55), transparent 60%),
    linear-gradient(160deg, var(--brand) 0%, var(--brand-deep) 100%);
}
/* grade sutil, igual à tela de login */
header::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
header > * { position: relative; }
.top { max-width: 1240px; margin: auto; padding: 16px max(4vw, 16px) 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brandbox { display: flex; align-items: center; gap: 18px; }
#logo { height: 64px; width: auto; flex: none; filter: drop-shadow(0 2px 8px rgba(0,0,0,.25)); }
.hd-txt { display: grid; gap: 8px; justify-items: start; }
.hd-badge { display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px; border: 1px solid rgba(255,255,255,.32); background: rgba(255,255,255,.06); font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; line-height: 1.2; }
.hd-badge svg { width: 13px; height: 13px; flex: none; }
.top h1 {
  /* Aptos (Office) quando instalada; senão Nunito Sans */
  font-family: 'Aptos', 'Aptos Display', 'Nunito Sans', system-ui, sans-serif;
  font-weight: 800; text-transform: uppercase; letter-spacing: .01em;
  font-size: clamp(20px, 2.6vw, 30px); line-height: 1.1;
}
.top h1 em { font-style: normal; color: var(--hl); }
.top h1 { text-wrap: balance; }
.topr { display: flex; gap: 8px; align-items: center; }
.topr-user { display: flex; gap: 6px; align-items: center; }
/* botão discreto de encerrar a sessão (só ícone) */
.btn-exit { width: 36px; height: 36px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.22); background: transparent; color: rgba(255,255,255,.62); display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; transition: color .15s, border-color .15s, background .15s; }
.btn-exit:hover, .btn-exit:focus-visible { color: #fff; border-color: rgba(255,255,255,.55); background: rgba(255,255,255,.08); }
.btn-exit svg { width: 16px; height: 16px; }
.pill-sync { display: flex; align-items: center; gap: 8px; border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.04); color: var(--brand-ink); border-radius: 99px; padding: 6px 12px; min-height: 36px; font-size: 13px; font-weight: 700; cursor: pointer; }
.pill-sync i { width: 10px; height: 10px; border-radius: 50%; background: #9aa3ad; flex: none; }
.pill-sync.on i { background: #3fc6b4; } .pill-sync.off i { background: #f5b83d; } .pill-sync.err i { background: #ff6b61; }
/* barra do módulo: botão Início + nome do módulo */
.modbar { max-width: 1240px; margin: auto; padding: 14px max(4vw, 16px) 16px; display: flex; align-items: center; gap: 14px; }
.mb-back { display: inline-flex; align-items: center; gap: 4px; color: var(--brand-ink); text-decoration: none; font-weight: 700; font-size: 14px; padding: 7px 14px 7px 9px; border-radius: 99px; border: 1.5px solid rgba(255,255,255,.35); background: rgba(255,255,255,.06); min-height: 38px; }
.mb-back:hover { background: rgba(255,255,255,.14); }
.mb-back svg { width: 18px; height: 18px; }
.mb-title { display: flex; align-items: center; gap: 10px; font-size: 20px; color: var(--brand-ink); }
.mb-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18); }
.mb-ico svg { width: 20px; height: 20px; }
body.na-home .top { padding-bottom: 18px; }

/* auditoria */
.aud-users { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.aud-user { display: flex; gap: 10px; align-items: flex-start; text-align: left; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; font: inherit; color: inherit; }
.aud-user:hover { border-color: var(--accent); }
.aud-user[aria-pressed=true] { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(154, 20, 45, .15); }
.aud-user b { display: block; }
.aud-user small { display: block; color: var(--mut); font-size: 12.5px; line-height: 1.35; }
.aud-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: 6px; background: #b8bec6; }
.aud-dot.on { background: #1fa38f; box-shadow: 0 0 0 3px rgba(31, 163, 143, .2); }
.aud-dot.hoje { background: var(--amb); }
.aud-filtros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.4fr); gap: 10px; align-items: end; }
.aud-tag { display: inline-block; font-size: 12px; font-weight: 800; padding: 2px 8px; border-radius: 99px; background: var(--soft); white-space: nowrap; }
.aud-tag.t-acesso { background: #e6eef8; color: #1d4f8a; }
.aud-tag.t-inspecao { background: #e7f4f1; color: var(--ok); }
.aud-tag.t-acao { background: #fbf1df; color: #8a5a00; }
.aud-tag.t-usuario { background: #f2e6f5; color: #6b2a7d; }
.aud-tag.t-cadastro, .aud-tag.t-sistema { background: var(--soft); color: var(--mut); }
.aud-alerta td:first-child { box-shadow: inset 3px 0 0 var(--red); }
.aud-alerta .aud-tag { background: #fbe4e2; color: var(--red); }
td.nw { white-space: nowrap; }

/* tela inicial: módulos em botões quadrados */
.home { min-height: calc(100vh - 240px); min-height: calc(100dvh - 240px); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 0 24px; }
.home-hd { text-align: center; margin-bottom: 26px; }
.home-hd h2 { font-size: 26px; }
.home-hd p { margin: 4px 0 0; }
.tiles { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; max-width: calc(4 * 172px + 3 * 18px); }
.tile { width: 172px; }
.tile {
  position: relative; aspect-ratio: 1; border-radius: 18px; background: var(--card); border: 1px solid var(--line);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px;
  text-decoration: none; color: var(--ink); text-align: center;
  box-shadow: 0 1px 2px rgba(20, 10, 12, .05), 0 6px 18px rgba(74, 10, 23, .06);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.tile:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: 0 10px 26px rgba(74, 10, 23, .14); }
.tile:active { transform: scale(.97); }
.tile-ico { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; color: #fff; margin-bottom: 6px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--brand) 100%); box-shadow: 0 6px 14px rgba(154, 20, 45, .28); }
.tile-ico svg { width: 32px; height: 32px; }
.tile b { font-size: 16px; line-height: 1.2; }
.tile small { font-size: 12.5px; color: var(--mut); line-height: 1.3; }
.tile-badge { position: absolute; top: 10px; right: 10px; min-width: 24px; height: 24px; padding: 0 7px; border-radius: 99px; background: var(--amb); color: #fff; font-size: 12.5px; font-weight: 800; display: grid; place-items: center; }
.tile-badge.red { background: var(--red); }

main { max-width: 1240px; margin: auto; padding: 20px max(4vw, 16px) 90px; outline: none; }

/* cartões e grades */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; margin-bottom: 16px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.row.between, .between { justify-content: space-between; }
.row.start { align-items: start; } .row.end { justify-content: flex-end; } .row.ac { gap: 8px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid2.g12 { gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }

/* filtros */
.filters-wrap { padding: 0; }
.filters-wrap summary { list-style: none; cursor: pointer; padding: 14px 18px; display: flex; gap: 10px; align-items: baseline; }
.filters-wrap summary span { margin-right: auto; }
.filters-wrap summary::-webkit-details-marker { display: none; }
.filters-wrap summary::after { content: '▾'; color: var(--mut); }
.filters-wrap[open] summary::after { content: '▴'; }
.filters { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 10px; align-items: end; padding: 0 18px 18px; }

/* indicadores */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; border-top: 5px solid var(--ink); text-decoration: none; display: block; }
a.kpi:hover { border-color: var(--accent); }
.kpi b { display: block; font-size: clamp(30px, 5vw, 44px); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 14px; color: var(--mut); font-weight: 600; }
.kpi.r { border-top-color: var(--red); } .kpi.a { border-top-color: var(--amb); } .kpi.o { border-top-color: var(--accent); }
.kpi.o b { color: var(--accent); }
.kpi.r b { color: var(--red); } .kpi.a b { color: var(--amb); }
.stackbar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: var(--soft); margin: 8px 0; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; color: var(--mut); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.bars { display: grid; gap: 10px; margin-top: 12px; }
.bar { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 10px; font-size: 14px; }
.bar .tr { grid-column: 1 / -1; height: 10px; background: var(--soft); border-radius: 5px; overflow: hidden; }
.bar .tr i { display: block; height: 100%; background: var(--ink); border-radius: 5px; }
.bar b { font-variant-numeric: tabular-nums; }
.podium { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.pod { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--soft); }
.pod .n { font-size: 34px; font-weight: 800; line-height: 1; color: var(--accent); }
.pod .nm { font-weight: 700; margin-top: 6px; overflow-wrap: anywhere; }
.pod small { color: var(--mut); }

/* tabelas */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; color: var(--mut); font-weight: 700; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.click { cursor: pointer; } tr.click:hover, tr.click:focus-visible { background: var(--soft); }
.scroll { overflow-x: auto; }
.scroll.tall { max-height: 480px; overflow-y: auto; }

/* status */
.pill { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; border: 1.5px solid currentColor; }
.p-Aberta { color: var(--red); } .p-Em { color: var(--amb); } .p-Fechada { color: var(--ok); }
.p-Vencida { background: var(--red); color: #fff; border-color: var(--red); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { min-height: 40px; padding: 8px 14px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; font-size: 14px; }
.chip[aria-pressed=true] { background: var(--ink); color: #fff; border-color: var(--ink); }
.cat { font-size: 12px; font-weight: 800; color: var(--accent); }

/* cadernos */
.cad { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 10px; }
.cadbtn { text-align: left; padding: 14px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; min-height: 84px; }
.cadbtn:hover { border-color: var(--accent); }
.cadbtn b { display: block; font-size: 17px; }
.cadbtn span { font-size: 14px; color: var(--mut); }

/* checklist */
.item { border-bottom: 1px solid var(--line); padding: 14px 0; }
.item .q { display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.item .num { font-weight: 800; color: var(--mut); font-variant-numeric: tabular-nums; }
.item.r-NC .q > span:nth-child(2) { color: var(--red); font-weight: 600; }
.seg { display: flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { min-width: 52px; min-height: 44px; border: 0; background: var(--card); font-weight: 800; cursor: pointer; border-left: 1.5px solid var(--line); }
.seg button:first-child { border-left: 0; }
.seg button[aria-pressed=true][data-s=C] { background: var(--ok); color: #fff; }
.seg button[aria-pressed=true][data-s=NC] { background: var(--red); color: #fff; }
.seg button[aria-pressed=true][data-s=NA] { background: var(--mut); color: #fff; }
.ncbox { margin: 12px 0 0 2.2em; padding: 14px; border-left: 4px solid var(--red); background: var(--soft); border-radius: 0 8px 8px 0; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ncbox .full { grid-column: 1 / -1; }
.lbl-spacer { display: block; height: 23px; }
.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 15px; min-height: 44px; margin: 0; }
.check input { width: 22px; min-height: 22px; }
.sticky { position: sticky; bottom: 0; background: var(--card); border-top: 3px solid var(--accent); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); margin: 0 -18px -18px; border-radius: 0 0 12px 12px; display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; z-index: 2; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.thumbs img { width: 84px; height: 84px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; background: var(--soft); }

/* ações */
.acts { display: grid; gap: 10px; }
.acao { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--red); border-radius: 10px; padding: 14px 16px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.acao.Em { border-left-color: var(--amb); } .acao.Fechada { border-left-color: var(--ok); }
.acao p { margin-bottom: 0; }
.acao .meta { display: flex; gap: 8px 14px; flex-wrap: wrap; font-size: 13px; color: var(--mut); margin-top: 6px; }
.acao .bt { display: flex; flex-direction: column; gap: 6px; }
.busca { flex: 1; min-width: 200px; max-width: 320px; }

/* listas, vazios, avisos */
.list { display: grid; gap: 6px; }
.li { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.li:last-child { border: 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--mut); }
.empty h2 { color: var(--ink); margin-bottom: 8px; }
.banner { background: #f5b83d; color: #1a1200; padding: 10px max(4vw, 16px); font-weight: 600; font-size: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
#toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 30; display: grid; gap: 8px; width: max-content; max-width: 92vw; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 10px; font-weight: 600; box-shadow: 0 6px 20px rgba(0,0,0,.2); }
.toast.err { background: var(--red); }

/* janela */
.ov { position: fixed; inset: 0; background: rgba(10,12,14,.55); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; z-index: 20; overflow-y: auto; overscroll-behavior: contain; }
.dlg { background: var(--card); border-radius: 14px; max-width: 720px; width: 100%; padding: 20px; border-top: 6px solid var(--accent); }
.dlg .hd { display: flex; justify-content: space-between; align-items: start; gap: 10px; margin-bottom: 14px; }
.fg { display: grid; gap: 12px; }
.confirm { margin-top: 12px; border-color: var(--red); }
.big img { max-width: 100%; border-radius: 8px; }
.tall-ta { min-height: 280px; }
.login { max-width: 420px; margin: 6vh auto; }

/* tablet */
@media (max-width: 900px) and (min-width: 701px) {
  .tiles { max-width: calc(3 * 172px + 2 * 18px); }
}
@media (max-width: 900px) {
  .aud-filtros { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .aud-busca { grid-column: 1 / -1; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
}

/* celular: navegação na parte de baixo da tela, ao alcance do polegar */
@media (max-width: 700px) {
  .top { padding: 12px 14px 14px; flex-wrap: nowrap; align-items: center; }
  .brandbox { gap: 10px; }
  #logo { height: 44px; }
  .hd-txt { gap: 5px; }
  .hd-badge { font-size: 8.5px; padding: 3px 6px; gap: 5px; letter-spacing: .06em; }
  .hd-badge svg { width: 10px; height: 10px; }
  .top h1 { font-size: 15px; }
  /* celular: título ocupa a largura toda; nome do usuário, sincronização e saída numa linha abaixo */
  .top { flex-wrap: wrap; row-gap: 10px; }
  .topr { width: 100%; display: flex; align-items: center; gap: 8px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.12); }
  .topr-user { display: contents; }
  #usermenu { order: 0; margin-right: auto; }
  #syncpill { order: 1; }
  .btn-exit { order: 2; }
  .pill-sync { padding: 4px 9px; min-height: 30px; font-size: 12px; }
  .pill-sync.on span { display: none; } /* sincronizado: só a bolinha verde */
  .btn-exit { width: 30px; height: 30px; }
  .btn-exit svg { width: 14px; height: 14px; }
  #usermenu { min-height: 34px; padding: 3px 12px 3px 4px; font-size: 13px; max-width: 70%; overflow: hidden; }
  #usermenu .um-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .modbar { padding: 4px 14px 12px; gap: 10px; }
  .mb-back { padding: 5px 11px 5px 7px; min-height: 34px; font-size: 13px; }
  .mb-title { font-size: 17px; gap: 8px; }
  .mb-ico { width: 28px; height: 28px; border-radius: 7px; }
  .mb-ico svg { width: 17px; height: 17px; }
  .home { min-height: 0; justify-content: flex-start; padding-top: 4px; }
  .home-hd { margin-bottom: 18px; }
  .home-hd h2 { font-size: 21px; }
  .tiles { gap: 12px; width: 100%; }
  .tile { width: calc((100% - 24px) / 3); }
  .tile { border-radius: 16px; padding: 8px 4px; gap: 3px; }
  .tile-ico { width: 48px; height: 48px; border-radius: 13px; margin-bottom: 4px; }
  .tile-ico svg { width: 25px; height: 25px; }
  .tile b { font-size: 13px; }
  .tile small { display: none; }
  .tile-badge { top: 6px; right: 6px; min-width: 20px; height: 20px; font-size: 11px; padding: 0 5px; }
  .ncbox { grid-template-columns: minmax(0, 1fr); margin-left: 0; }
  .lbl-spacer { display: none; }
  .item .q { grid-template-columns: 1.8em minmax(0, 1fr); }
  .item .seg { grid-column: 1 / -1; }
  .seg button { flex: 1; min-height: 48px; }
  .acao { grid-template-columns: minmax(0, 1fr); }
  .acao .bt { flex-direction: row; flex-wrap: wrap; }
  .podium { grid-template-columns: minmax(0, 1fr); }
  .busca { max-width: none; }
  .dlg { padding: 16px; }
  .ov { padding: 2vh 8px; }
  table { font-size: 13px; }
  .stack thead { display: none; }
  .stack tr { display: grid; padding-block: 10px; border-bottom: 1px solid var(--line); }
  .stack td { display: flow-root; border: 0; padding: 3px 0; padding-inline-start: 8em; text-align: start; }
  .stack td.n { text-align: start; white-space: normal; }
  .stack td::before { content: attr(data-l); float: inline-start; width: 7.5em; margin-inline-start: -8em; white-space: normal; color: var(--mut); }
  .stack td:empty { display: none; }
}
@media (max-width: 380px) { .tile b { font-size: 12px; } }


/* =====================================================================
   v5 — menu lateral (computador), menu inferior com botão + (celular),
   tela inicial com resumo e painéis
   ===================================================================== */
.col { min-width: 0; }

/* conta do usuário: iniciais + nome (+ perfil no menu lateral) */
#usermenu { display: inline-flex; align-items: center; gap: 8px; }
#usermenu .av { width: 26px; height: 26px; border-radius: 50%; background: var(--hl); color: #4a0a17; display: grid; place-items: center; font-size: 11px; font-weight: 900; flex: none; }
#usermenu .um-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.15; min-width: 0; }
#usermenu .um-perfil { display: none; font-size: 12px; font-weight: 600; opacity: .7; }

/* menu lateral: só no computador */
.side { display: none; }
@media (min-width: 900px) {
  #app { display: grid; grid-template-columns: 272px minmax(0, 1fr); min-height: 100vh; min-height: 100dvh; }
  .side {
    display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; height: 100dvh; overflow-y: auto;
    padding: 22px 14px 16px; box-sizing: border-box; color: #fff;
  }
  .side {
    background:
      linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 32px 32px,
      linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 32px 32px,
      radial-gradient(ellipse at 0% 0%, rgba(154, 20, 45, .55), transparent 60%),
      linear-gradient(170deg, var(--brand) 0%, var(--brand-deep) 100%);
  }
  /* marca no topo do menu lateral (fica sempre visível) */
  .side-brand { display: flex; align-items: center; gap: 10px; padding: 0 2px 18px; border-bottom: 1px solid rgba(255,255,255,.12); color: #fff; text-decoration: none; }
  .side-brand img { height: 50px; width: auto; flex: none; filter: drop-shadow(0 2px 6px rgba(0,0,0,.25)); }
  .sb-txt { display: grid; gap: 6px; justify-items: start; min-width: 0; }
  .side-brand .hd-badge { font-size: 7.6px; padding: 3px 6px; gap: 4px; letter-spacing: .05em; white-space: nowrap; }
  .side-brand .hd-badge svg { width: 9px; height: 9px; }
  .sb-title { font-family: 'Aptos', 'Aptos Display', 'Nunito Sans', system-ui, sans-serif; font-weight: 800; text-transform: uppercase; letter-spacing: .01em; font-size: 15px; line-height: 1.12; text-wrap: balance; }
  .sb-title em { font-style: normal; color: var(--hl); }
  .side-nav { display: flex; flex-direction: column; gap: 3px; }
  .side-nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: rgba(255,255,255,.78); text-decoration: none; font-weight: 700; font-size: 14.5px; min-height: 44px; box-sizing: border-box; }
  .side-nav a svg { width: 20px; height: 20px; flex: none; }
  .side-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
  .side-nav a[aria-current=page] { background: rgba(255,255,255,.15); color: #fff; box-shadow: inset 3px 0 0 var(--hl); }
  .side-bottom { margin-top: auto; }
  .side .topr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
  .side .topr-user { display: contents; }
  .side #usermenu { grid-column: 1 / -1; grid-row: 1; justify-content: flex-start; width: 100%; min-height: 52px; padding: 8px 10px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); color: #fff; text-align: left; }
  .side #usermenu:hover { background: rgba(255,255,255,.14); }
  .side #usermenu .av { width: 34px; height: 34px; font-size: 13px; }
  .side #usermenu .um-perfil { display: block; }
  .side #syncpill { grid-column: 1; grid-row: 2; justify-self: start; }
  .side .btn-exit { grid-column: 2; grid-row: 2; }

  /* sem faixa no topo: a marca fica no menu lateral; só o nome do módulo, sobre a página */
  header { background: none; color: var(--ink); padding-top: 0; }
  header::before { display: none; }
  .top { display: none; }
  .modbar { max-width: 1280px; padding: 24px 32px 0; }
  .mb-back { display: none; }
  .mb-title { color: var(--ink); font-size: 22px; }
  .mb-ico { background: #fdecef; border-color: #f3d3da; color: var(--accent); }
  body.na-home main { padding-top: 28px; }
  main { max-width: 1280px; padding: 20px 32px 48px; }
  .tabbar { display: none !important; }
}

/* menu inferior: só no celular/tablet */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; height: calc(68px + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); align-items: center;
  box-shadow: 0 -4px 20px rgba(0,0,0,.05);
}
.tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 56px; color: #6b7280; text-decoration: none; font: inherit; font-size: 11px; font-weight: 700; background: none; border: 0; cursor: pointer; }
.tabbar svg { width: 23px; height: 23px; }
.tabbar [aria-current=page] { color: var(--accent); font-weight: 800; }
.tabbar .tab-fab { justify-self: center; width: 60px; height: 60px; min-height: 0; margin-top: -30px; border-radius: 50%; color: #fff; border: 4px solid var(--bg);
  background: linear-gradient(150deg, #b3172f, var(--brand)); box-shadow: 0 8px 20px rgba(154, 20, 45, .4); }
.tabbar .tab-fab svg { width: 27px; height: 27px; }
.tabbar .tab-fab[aria-current=page] { color: #fff; }
@media (max-width: 899px) {
  main { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }
  #toasts { bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* preenchendo um caderno: menu inferior some para a barra "Salvar" ocupar o rodapé */
  body.foco .tabbar { display: none; }
  body.foco main { padding-bottom: 40px; }
  body.foco #toasts { bottom: calc(96px + env(safe-area-inset-bottom)); }
}

/* botões de módulo (celular e janela "Mais") com tons por módulo */
.tiles-sm { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: none; width: 100%; }
.tiles-sm .tile { width: auto; aspect-ratio: auto; padding: 14px 6px; gap: 8px; border-radius: 18px; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.tiles-sm .tile-ico { width: 46px; height: 46px; border-radius: 14px; margin: 0; box-shadow: none; }
.tiles-sm .tile-ico svg { width: 23px; height: 23px; }
.tiles-sm .tile b { font-size: 13px; }
.c-vinho .tile-ico { background: #fdecef; color: #9a142d; }
.c-ambar .tile-ico { background: #fff1db; color: #8f5300; }
.c-verde .tile-ico { background: #e3f3ef; color: #0b6e63; }
.c-azul  .tile-ico { background: #e6eef8; color: #1d4f8a; }
.c-roxo  .tile-ico { background: #efe9f7; color: #5e3a86; }
.c-teal  .tile-ico { background: #e2f1f5; color: #155e70; }
.c-cinza .tile-ico { background: #edeff2; color: #3e4652; }

/* tela inicial */
.home2 { display: flex; flex-direction: column; gap: 16px; }
.h2-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.h2-dia { margin: 0; font-size: 14px; }
.h2-saud { font-family: 'Nunito', 'Nunito Sans', sans-serif; font-size: 28px; font-weight: 900; margin-top: 2px; }
.h2-nova svg { flex: none; }
.h2-resumo { display: none; }
.h2-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.kpi2 { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s; }
.kpi2:hover { border-color: #e3c3ca; box-shadow: 0 6px 18px rgba(74, 10, 23, .07); }
.kpi2 > span { font-size: 13px; color: var(--mut); font-weight: 700; }
.kpi2 > div { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; min-height: 34px; }
.kpi2 b { font-family: 'Nunito', 'Nunito Sans', sans-serif; font-size: 34px; font-weight: 900; line-height: 1; }
.kpi2 small { font-size: 12.5px; color: var(--mut); }
.spark { flex: none; opacity: .85; }
.h2-cont { display: flex; gap: 14px; align-items: center; text-decoration: none; color: inherit; border: 1.5px solid #f0d4da; margin: 0; }
.h2-cont:hover { border-color: var(--accent); }
.h2-cont-ico { width: 46px; height: 46px; flex: none; border-radius: 13px; background: #fdecef; color: var(--accent); display: grid; place-items: center; }
.h2-cont-ico svg { width: 23px; height: 23px; }
.h2-cont-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.h2-cont-txt small { font-size: 12px; font-weight: 800; color: var(--accent); text-transform: uppercase; letter-spacing: .05em; }
.barra { display: block; height: 8px; background: #f1e4e7; border-radius: 4px; overflow: hidden; }
.barra i { display: block; height: 100%; background: linear-gradient(90deg, #b3172f, var(--brand)); border-radius: 4px; }
.h2-sec { font-family: 'Nunito', 'Nunito Sans', sans-serif; font-size: 17px; font-weight: 800; margin: 4px 0 -4px; }
.h2-so-cel { display: none; }
.h2-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.h2-colA, .h2-colB { display: flex; flex-direction: column; gap: 16px; }
.h2-card { margin: 0; }
.h2-card h3 { font-family: 'Nunito', 'Nunito Sans', sans-serif; font-size: 17px; font-weight: 800; }
.h2-lista { display: flex; flex-direction: column; margin-top: 6px; }
.h2-acao { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.h2-acao:last-child { border-bottom: 0; }
.h2-acao:hover b { color: var(--accent); }
.av2 { width: 38px; height: 38px; flex: none; border-radius: 50%; background: #f1eff0; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #3e4652; }
.h2-acao-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.h2-acao-txt b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2-acao-txt small { font-size: 12.5px; color: var(--mut); }
.h2-barras { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.h2-barra { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) 32px; gap: 12px; align-items: center; font-size: 13.5px; }
.h2-barra > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h2-barra > b { text-align: right; }
.h2-podio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; margin-top: 12px; }
.pod2 { border-radius: 14px; padding: 12px 8px; text-align: center; display: flex; flex-direction: column; justify-content: flex-end; background: var(--soft); min-height: 96px; box-sizing: border-box; }
.pod2 b { font-size: 13.5px; overflow-wrap: anywhere; }
.pod2 small { font-size: 12px; color: var(--mut); }
.pod2 span { font-family: 'Nunito', 'Nunito Sans', sans-serif; font-size: 22px; font-weight: 900; color: #8a919b; }
.pod2.p1 { min-height: 132px; color: #fff; background: linear-gradient(160deg, #b3172f, var(--brand)); }
.pod2.p1 small { color: rgba(255,255,255,.8); }
.pod2.p1 span { color: #ffd27a; font-size: 26px; }
.pod2.p3 { min-height: 84px; }
.pod2.p3 span { color: #a5703f; }
.h2-frentes { display: flex; gap: 18px; align-items: center; margin-top: 10px; }
.h2-frentes svg { flex: none; }
.h2-frentes-l { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 14px; min-width: 0; }
.h2-frentes-l div { display: flex; justify-content: space-between; gap: 10px; }

@media (max-width: 899px) {
  .h2-kpis, .h2-so-pc, .h2-nova { display: none; }
  .h2-so-cel { display: block; }
  nav.h2-so-cel { display: grid; }
  .h2-grid { grid-template-columns: minmax(0, 1fr); }
  .h2-resumo { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; padding: 14px 10px; margin: 0; border-radius: 20px; box-shadow: 0 8px 24px rgba(74, 10, 23, .08); border: 0; }
  .r-col { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-align: center; text-decoration: none; color: inherit; }
  .r-col + .r-col { border-left: 1px solid var(--line); }
  .r-col b { font-family: 'Nunito', 'Nunito Sans', sans-serif; font-size: 30px; font-weight: 900; line-height: 1; }
  .r-col > span { font-size: 12px; color: var(--mut); font-weight: 600; line-height: 1.25; }
  .r-venc { font-style: normal; font-size: 11px; font-weight: 800; color: #fff; background: var(--red); border-radius: 99px; padding: 1px 8px; }
  .h2-saud { font-size: 24px; }
  .h2-card .h2-acao:nth-child(n+4) { display: none; }
}


/* tela de inspeção (v5): itens em cartões, botões grandes, progresso e "Salvar" sempre à mão */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.chk-hd { margin-bottom: 12px; }
.prog2 { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 2px 10px; margin-bottom: 4px; }
.prog2-t { display: flex; justify-content: space-between; font-size: 13px; font-weight: 700; color: var(--mut); margin-bottom: 6px; }
.prog2-bar { display: flex; height: 8px; border-radius: 4px; background: #e8e4e5; overflow: hidden; }
.prog2-bar i { display: block; height: 100%; transition: width .25s; }
#pb-c { background: #1fa38f; } #pb-nc { background: var(--red); } #pb-na { background: #9aa3ad; }
.itens2 { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.item2 { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.item2.r-NC { border-color: #f0b9c3; }
.item2.r-C { border-color: #cde9e3; }
.q2 { display: flex; gap: 10px; align-items: flex-start; }
.num2 { width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--soft); display: grid; place-items: center; font-size: 13px; font-weight: 800; color: var(--mut); }
.q2-t { font-size: 15.5px; line-height: 1.45; font-weight: 600; padding-top: 2px; }
.seg2 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg2 button { height: 48px; border-radius: 12px; border: 1.5px solid #e2e4e8; background: #fff; font: inherit; font-weight: 800; font-size: 15px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.seg2 .s-C { color: #0b6e63; } .seg2 .s-NC { color: var(--red); } .seg2 .s-NA { color: var(--mut); }
.seg2 .s-C[aria-pressed=true] { background: #0b7c70; border-color: #0b7c70; color: #fff; }
.seg2 .s-NC[aria-pressed=true] { background: var(--red); border-color: var(--red); color: #fff; }
.seg2 .s-NA[aria-pressed=true] { background: #5b6270; border-color: #5b6270; color: #fff; }
.nc2 { background: #fdf4f5; border-radius: 12px; padding: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.nc2 .full { grid-column: 1 / -1; }
.nc2 label { color: #8f1428; }
.nc2 textarea, .nc2 input:not([type=checkbox]) { border-color: #f0d4da; }
.nc2-foto { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.nc2-foto .thumbs:empty { display: none; }
.nc2 .check { margin-left: auto; color: var(--ink); }
.btn-foto { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 99px; border: 1.5px dashed #e7b3bd; background: #fff; color: var(--accent) !important; font-weight: 800; font-size: 14px; cursor: pointer; margin: 0; }
.btn-foto:hover { border-style: solid; }
/* foto da correção no ato: verde, para diferenciar da foto do desvio */
.nc2-corr { background: #eef8f4; border: 1px solid #cfe9df; border-radius: 10px; padding: 10px; }
.nc2-corr .nc2-lbl { flex-basis: 100%; font-size: 13px; font-weight: 800; color: #0b7a5c; }
.btn-foto.ok { border-color: #8fcfb8; color: #0b7a5c !important; }
.savebar { position: sticky; bottom: 0; z-index: 6; display: flex; gap: 10px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 75%, rgba(244,244,241,0)); }
.savebar .btn { height: 52px; border-radius: 14px; font-size: 15px; }
.savebar .btn.pri { flex: 1; font-size: 16px; }
@media (max-width: 700px) {
  .nc2 { grid-template-columns: minmax(0, 1fr); }
  .nc2 .check { margin-left: 0; }
}

/* impressão: só o relatório */
#print { display: none; }
@media print {
  @page { size: A4; margin: 12mm; }
  body.imprimindo { background: #fff; }
  body.imprimindo #app, body.imprimindo #modal, body.imprimindo #toasts, body.imprimindo .skip { display: none !important; }
  body.imprimindo #print { display: block; }
}
