/* App da governança — mesma identidade do PMS (paleta, Figtree, ícones Lucide) */
@font-face { font-family: Figtree; font-weight: 300 900; font-display: swap; src: url(/fonts/figtree-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
[hidden] { display: none !important; }
:root {
  color-scheme: light;
  --bg: #ecede8; --surface: #fff; --surface-2: #f4f5f1; --border: #e4e6dd; --border-2: #cfd3c5;
  --text: #263441; --text-2: #3c4a56; --sub: #56615b; --faint: #707972;
  --primary: #3e5468; --primary-soft: #e6ecf2; --primary-text: #3e5468;
  --danger: #c10007; --danger-soft: #fbe7e5; --late: #b45309;
  --sujo: #854d0e; --sujo-bg: #fefce8; --sujo-ring: #fde047; --sujo-dot: #facc15;
  --limpo: #c2410c; --limpo-bg: #fff7ed; --limpo-ring: #fed7aa; --limpo-dot: #f97316;
  --vist: #047857; --vist-bg: #ecfdf5; --vist-ring: #a7f3d0; --vist-dot: #10b981;
  --said: #1d4ed8; --said-bg: #eff6ff; --said-ring: #bfdbfe; --said-dot: #2563eb;
  --other: #3c4a56; --other-bg: #f4f5f1; --other-ring: #cfd3c5; --other-dot: #6b7670;
  --shadow: 0 1px 2px rgba(38,52,65,.06), 0 2px 8px rgba(38,52,65,.05);
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #181e1c; --surface: #212824; --surface-2: #29302c; --border: #333a35; --border-2: #414843;
  --text: #f0f2ee; --text-2: #e3e6e2; --sub: #b9c0bb; --faint: #a1a9a3;
  --primary: #52708c; --primary-soft: #263441; --primary-text: #9fbad3;
  --danger: #ffa2a2; --danger-soft: #58332c; --late: #fcd34d;
  --sujo: #fde047; --sujo-bg: #3a2a08; --sujo-ring: #713f12;
  --limpo: #fdba74; --limpo-bg: #431407; --limpo-ring: #7c2d12;
  --vist: #6ee7b7; --vist-bg: #022c22; --vist-ring: #064e3b;
  --said: #93c5fd; --said-bg: #172554; --said-ring: #1e3a8a;
  --other: #e3e6e2; --other-bg: #29302c; --other-ring: #414843;
  --shadow: 0 1px 2px rgba(0,0,0,.3);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0 auto; max-width: 560px; min-height: 100dvh; font-family: Figtree, system-ui, sans-serif; font-size: 16.5px; background: var(--bg); color: var(--text); font-variant-numeric: tabular-nums; }
button { font: inherit; color: inherit; cursor: pointer; }
svg.i { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 2px; background: var(--surface); border-bottom: 1px solid var(--border); padding: calc(8px + env(safe-area-inset-top)) 8px 8px; min-height: 58px; }
.topbar h1 { flex: 1; margin: 0 0 0 8px; font-size: 19px; font-weight: 700; }
.icon-btn { display: flex; padding: 10px; border: 0; border-radius: 10px; background: none; color: var(--sub); font-size: 22px; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn.off { opacity: .45; }
#btn-back { margin-right: -8px; font-size: 24px; }
main { padding: 14px 14px calc(24px + env(safe-area-inset-bottom)); }

.tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.tabs button { border: 0; background: none; border-radius: 9px; padding: 10px; font-weight: 600; color: var(--sub); }
.tabs button.on { background: var(--primary); color: #fff; }
.date { display: flex; align-items: center; justify-content: center; gap: 7px; margin: 12px 0; font-size: 15.5px; font-weight: 500; color: var(--sub); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { display: flex; align-items: center; gap: 11px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.kpi .ball { display: flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; font-size: 21px; flex: none; }
.kpi b { display: block; font-size: 24px; font-weight: 800; line-height: 1; }
.kpi span.l { display: block; margin-top: 3px; font-size: 14px; line-height: 1.2; color: var(--sub); }
.c-sujo { color: var(--sujo); background: var(--sujo-bg); box-shadow: inset 0 0 0 1px var(--sujo-ring); }
.c-limpo { color: var(--limpo); background: var(--limpo-bg); box-shadow: inset 0 0 0 1px var(--limpo-ring); }
.c-vistoriado { color: var(--vist); background: var(--vist-bg); box-shadow: inset 0 0 0 1px var(--vist-ring); }
.c-saida { color: var(--said); background: var(--said-bg); box-shadow: inset 0 0 0 1px var(--said-ring); }
.c-other { color: var(--other); background: var(--other-bg); box-shadow: inset 0 0 0 1px var(--other-ring); }

h2 { display: flex; justify-content: space-between; margin: 20px 2px 9px; font-size: 17px; font-weight: 700; }
h2 small { font-size: 15px; font-weight: 500; color: var(--sub); }
.card { display: block; width: 100%; margin-bottom: 10px; padding: 0; text-align: left; overflow: hidden; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); }
.card:active { border-color: var(--border-2); }
.card .row { display: flex; gap: 12px; padding: 12px; align-items: stretch; }
.pic-wrap { position: relative; width: 96px; min-height: 92px; flex: none; border-radius: 10px; overflow: hidden; background: var(--surface-2); }
.pic-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card .body { flex: 1; min-width: 0; }
.card .head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.card .num { font-size: 21px; font-weight: 800; line-height: 1; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; }
.badge.c-sujo::before { background: var(--sujo-dot); } .badge.c-limpo::before { background: var(--limpo-dot); } .badge.c-vistoriado::before { background: var(--vist-dot); } .badge.c-saida::before { background: var(--said-dot); } .badge.c-other::before { background: var(--other-dot); }
.ln { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: 15.5px; color: var(--text-2); }
.ln svg { font-size: 17px; color: var(--faint); }
.ln b { font-weight: 700; }
.late { color: var(--late); font-weight: 700; }
.ln.muted { color: var(--sub); }
.items { display: flex; border-top: 1px solid var(--border); }
.items span { flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px; height: 38px; font-size: 15px; font-weight: 700; }
.items span + span { border-left: 1px solid var(--border); }
.items svg { font-size: 20px; }
.items .no { color: var(--faint); font-weight: 500; }
.note { display: flex; gap: 8px; padding: 9px 12px; border-top: 1px solid var(--border); font-size: 15px; line-height: 1.35; color: var(--text-2); }
.note svg { font-size: 17px; margin-top: 1px; color: var(--faint); }
.note span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.allok { text-align: center; padding: 34px 16px; margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; }
.allok .ball, .done .ball { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.allok .ball { width: 60px; height: 60px; font-size: 29px; }
.allok p { margin: 12px 0 0; font-size: 17px; font-weight: 700; }
.allok small { display: block; margin-top: 4px; font-size: 15.5px; color: var(--sub); }

.hero { display: block; width: 60%; margin: 0 auto; aspect-ratio: 3/2; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); }
.dhead { display: flex; justify-content: space-between; align-items: center; margin: 14px 2px 12px; gap: 8px; }
.dhead .num { font-size: 26px; font-weight: 800; line-height: 1; }
.dhead .badge { font-size: 15px; padding: 5px 12px; }
.box { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); padding: 4px 14px; margin-bottom: 12px; }
.box h3 { margin: 10px 0 4px; font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--sub); }
.kv { display: flex; align-items: center; gap: 10px; min-height: 44px; border-top: 1px solid var(--border); }
h3 + .kv { border-top: 0; }
.kv svg { font-size: 20px; color: var(--sub); }
.kv .v { margin-left: auto; font-weight: 700; text-align: right; }
.kv .v.no { color: var(--faint); font-weight: 500; }
.kv .v small { display: block; font-size: 14px; font-weight: 500; color: var(--sub); }
.txt { margin: 4px 0 12px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.foot { position: sticky; bottom: 0; padding: 10px 0 calc(6px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 22%); }
.btn { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; padding: 15px; border: 0; border-radius: 12px; font-size: 17px; font-weight: 700; }
.btn svg { font-size: 20px; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.secondary { margin-top: 10px; background: var(--surface); border: 1px solid var(--border-2); }
.btn:disabled { background: var(--border); color: var(--faint); cursor: default; }
.why { text-align: center; margin: 8px 0 0; font-size: 15px; color: var(--sub); }

.modal-bg { position: fixed; inset: 0; z-index: 30; display: flex; align-items: flex-end; justify-content: center; background: rgba(16,22,26,.55); }
.modal { width: 100%; max-width: 560px; padding: 20px 16px calc(16px + env(safe-area-inset-bottom)); background: var(--surface); border-radius: 18px 18px 0 0; animation: up .18s ease-out; }
.modal h3 { margin: 0 0 4px; font-size: 18px; } .modal p { margin: 0 0 16px; font-size: 15.5px; color: var(--sub); }
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.done { text-align: center; padding: 12vh 8px 0; }
.done .ball { width: 116px; height: 116px; font-size: 58px; animation: pop .35s cubic-bezier(.2,1.5,.4,1); }
.done h2 { justify-content: center; margin: 24px 0 8px; font-size: 25px; font-weight: 800; }
.done p { margin: 0 auto 22px; max-width: 290px; line-height: 1.45; color: var(--text-2); }
.done .ok { display: flex; align-items: center; justify-content: center; gap: 9px; padding: 13px; margin-bottom: 22px; border-radius: 12px; font-size: 15.5px; font-weight: 600; }
.done .ok svg { font-size: 19px; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.login { padding: 13vh 10px 0; }
.login .logo { text-align: center; font-size: 34px; font-weight: 800; letter-spacing: -.03em; } .login .logo i { font-style: normal; color: #597c61; }
.login .sub { text-align: center; margin: 2px 0 30px; font-size: 13px; font-weight: 600; letter-spacing: .28em; text-transform: uppercase; color: var(--sub); }
.login label { display: block; margin-bottom: 14px; font-size: 15.5px; font-weight: 600; color: var(--text-2); }
.login input { width: 100%; margin-top: 6px; padding: 13px; font: inherit; font-size: 17px; border: 1px solid var(--border-2); border-radius: 10px; background: var(--surface); color: var(--text); }
.login .pw { position: relative; display: block; } .login .pw input { padding-right: 48px; }
.login .pw button { position: absolute; right: 3px; bottom: 3px; }
.err { min-height: 20px; margin: 0 0 8px; font-size: 15.5px; font-weight: 600; color: var(--danger); }
.offline { display: flex; align-items: center; gap: 8px; padding: 10px 12px; margin-bottom: 12px; border-radius: 10px; font-size: 15.5px; font-weight: 600; background: var(--danger-soft); color: var(--danger); }
.offline svg { font-size: 18px; }
#toast { position: fixed; left: 50%; bottom: calc(28px + env(safe-area-inset-bottom)); transform: translate(-50%, 16px); width: max-content; max-width: 90%; padding: 10px 16px; border-radius: 10px; background: #10161a; color: #f0f2ee; font-size: 15.5px; font-weight: 500; opacity: 0; pointer-events: none; transition: .2s; z-index: 40; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.kpi { min-width: 0; }
.card .head { flex-wrap: wrap; }
@media (max-width: 350px) { .pic-wrap { width: 72px; } .kpi { padding: 10px 8px; gap: 8px; } .kpi .ball { width: 36px; height: 36px; font-size: 18px; } .badge { font-size: 12.5px; padding: 3px 7px; } }

.kpi { text-align: left; border-color: var(--border); transition: border-color .15s; }
.kpi.on { border-color: var(--primary-text); box-shadow: 0 0 0 1px var(--primary-text); }
.clear { border: 0; background: none; padding: 4px 2px; margin: -4px 0; font-size: 15px; font-weight: 600; color: var(--primary-text); }
.none { margin: 0 0 10px; padding: 14px; text-align: center; font-size: 15.5px; color: var(--sub); border: 1px dashed var(--border-2); border-radius: 14px; }
h2.day { font-size: 16.5px; }
.pic-wrap.small { width: 72px; min-height: 64px; }
.txt.sep { margin: 0; padding: 10px 0 12px; border-top: 1px solid var(--border); }
