/* LeadBoard no celular — cores do Painel (verde LeadBoard: Esmeralda no claro, Floresta no escuro) e cabeçalho D4 da barra lateral.
 * Sem barras de rolagem à vista (pedido do Júlio a 06/12: no celular arrasta-se o dedo). */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("partilhado/plus-jakarta-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-weight: 400 800; font-display: swap; src: url("partilhado/plus-jakarta-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+2020, U+20A0-20AB, U+20AD-20C4; }

:root {
  color-scheme: light;
  --bg: #f3f6f4; --surface: #fff; --surface-2: #eef3f0; --seg: #e8efeb; --fg: #0f1d17; --muted: #52645b; --line: #dfe7e2; --line-2: #cfdad3;
  --accent: #0f8a5f; --accent-2: #0b7350; --accent-soft: #e1f4eb;
  --head: linear-gradient(90deg, #0f8a5f 0%, #0b7350 48%, #0e5f6b 100%); --head-sub: #d6f3e6;
  --dado: #2563eb; --dado-soft: #e7eeff; --bom: #16a34a; --bom-soft: #dcf5e7; --medio: #8a5300; --medio-soft: #fff1d6; --mau: #b42318; --mau-soft: #fde4e4;
  --sombra: 0 1px 2px rgba(15,29,23,.04), 0 2px 8px rgba(15,29,23,.05);
  --nav-h: 64px; --topo-pad: max(18px, env(safe-area-inset-top));
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #08110e; --surface: #0f1b17; --surface-2: #15241f; --seg: #15241f; --fg: #e6f2ec; --muted: #9db3a8; --line: #1e3029; --line-2: #2a4038;
    --accent: #34d399; --accent-2: #2bb583; --accent-soft: #123327;
    --head: linear-gradient(90deg, #0d5a40 0%, #0a4632 48%, #0b3f48 100%); --head-sub: #a6c7b6;
    --dado: #60a5fa; --dado-soft: #1a2a52; --bom: #22c55e; --bom-soft: #12311f; --medio: #f5b54a; --medio-soft: #33270f; --mau: #f87171; --mau-soft: #3a1717;
    --sombra: 0 1px 2px rgba(0,0,0,.3);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--fg); overscroll-behavior-y: none; }
body { font: 400 15px/1.4 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, p { margin: 0; }
.so-leitor { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.tela { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
.conteudo { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; padding: 16px 16px calc(var(--nav-h) + 24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.tela-ficha .conteudo { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

/* Cabeçalho verde */
.topo { background: var(--head); color: #fff; padding: var(--topo-pad) 20px 18px; display: flex; flex-direction: column; gap: 14px; flex: none;
  padding-left: max(20px, env(safe-area-inset-left)); padding-right: max(20px, env(safe-area-inset-right)); }
.topo-l { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; }
.topo-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.topo h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.topo-sub, .topo-info, .topo-p { font-size: 13px; color: var(--head-sub); }
.topo-p { margin-top: -6px; }
.topo-bt { width: 44px; height: 44px; border-radius: 22px; background: rgba(255,255,255,.16); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px; color: #fff; flex: none; border: 0; }
.topo-sel { position: relative; display: flex; align-items: center; gap: 4px; color: var(--head-sub); font-size: 13.5px; }
.topo-sel select { appearance: none; -webkit-appearance: none; background: transparent; border: 0; color: #fff; font-weight: 700; font-size: 14px; padding: 10px 18px 10px 0; text-align: right; max-width: 190px; }
.topo-sel select option { color: #0f1d17; }
.topo-sel svg { position: absolute; right: 0; pointer-events: none; color: #fff; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.kpi { background: rgba(255,255,255,.14); border-radius: 14px; padding: 10px 8px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.kpi b { font-size: 22px; font-weight: 800; line-height: 1.1; }
.kpi span { font-size: 11px; line-height: 1.25; color: #e3f6ee; }
.busca { display: flex; align-items: center; gap: 10px; background: #fff; color: #52645b; border-radius: 12px; padding: 0 14px; min-height: 46px; }
.busca input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: #0f1d17; font-size: 16px; }
.busca input::-webkit-search-cancel-button { -webkit-appearance: none; }
.topo-ficha { gap: 14px; padding-bottom: 18px; }
.topo-resp { font-size: 12.5px; color: var(--head-sub); display: flex; align-items: center; gap: 6px; }
.topo-resp i { width: 18px; height: 18px; border-radius: 9px; color: #fff; font-size: 10px; font-weight: 800; font-style: normal; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.ficha-id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.ficha-id div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ficha-id h1 { font-size: 22px; overflow-wrap: anywhere; }
.ficha-id span { font-size: 13.5px; color: var(--head-sub); }

/* Navegação de baixo */
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--nav-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); z-index: 5; }
.nav-i { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.nav-i.on { color: var(--accent); font-weight: 700; }
.nav-n { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #d97706; color: #fff; font-size: 10.5px; font-weight: 800; display: flex; align-items: center; justify-content: center; }

/* Seletores */
.seg { display: flex; gap: 6px; background: var(--seg); border-radius: 12px; padding: 4px; flex: none; }
.seg button { flex: 1; min-height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.seg button.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 3px rgba(15,29,23,.1); }
.linha-fil .seg { width: 190px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.rola { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
.caixa .chips.rola { margin: 0 -16px; padding: 0 16px; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font-size: 13.5px; font-weight: 700; display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip:disabled { opacity: .55; }
.etapa { flex: none; min-height: 54px; padding: 6px 14px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; }
.etapa b { font-size: 13px; white-space: nowrap; }
.etapa small { font-size: 12px; opacity: .85; white-space: nowrap; }
.etapa.on { color: #fff; }

/* Listas e cartões */
.lista { display: flex; flex-direction: column; gap: 10px; }
.cartao { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 10px; }
.cartao-cab { display: flex; gap: 12px; align-items: center; min-width: 0; }
.cartao-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cartao-txt b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cartao-txt small, .linha-txt small { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.cartao-msg { font-size: 13px; color: var(--muted); line-height: 1.45; overflow-wrap: anywhere; }
.cartao-bts { display: flex; gap: 8px; }
.cartao-q { border-top: 3px solid var(--line); gap: 6px; padding: 12px 14px; }
.q-l1, .q-l3 { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.q-l1 b:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-l1 b:last-child { white-space: nowrap; font-size: 14px; }
.cartao-q small { font-size: 12px; color: var(--muted); }
.q-resp { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.linha { background: var(--surface); border-radius: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 12px; box-shadow: 0 1px 2px rgba(15,29,23,.04); min-width: 0; }
.linha-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.linha-nome { display: flex; align-items: center; gap: 6px; min-width: 0; }
.linha-nome b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linha-dir { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.linha-dir small { font-size: 12px; color: var(--muted); }
.quebra { white-space: normal !important; display: block !important; }
.selo { font-size: 11px; font-weight: 700; background: var(--bom-soft); color: var(--bom); border-radius: 6px; padding: 2px 6px; flex: none; }
.ponto { width: 8px; height: 8px; border-radius: 4px; flex: none; display: inline-block; }
.av { width: 42px; height: 42px; border-radius: 21px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.av-g { width: 58px; height: 58px; border-radius: 29px; font-size: 20px; font-weight: 800; box-shadow: 0 0 0 3px rgba(255,255,255,.35); }
.resp { width: 22px; height: 22px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #fff; flex: none; }
.resp.livre { background: var(--seg); color: var(--muted); }
.pilula { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 999px; white-space: nowrap; flex: none; }
.pilula.ok { background: var(--accent-soft); color: var(--accent-2); }
.pilula.bom { background: var(--bom-soft); color: var(--bom); }
.pilula.medio { background: var(--medio-soft); color: var(--medio); }
.pilula.mau { background: var(--mau-soft); color: var(--mau); }
.pilula.neutro { background: var(--surface-2); color: var(--muted); }
.av-ic { width: 38px; height: 38px; border-radius: 10px; flex: none; display: flex; align-items: center; justify-content: center; }
.t-medio { background: var(--medio-soft); color: var(--medio); } .t-mau { background: var(--mau-soft); color: var(--mau); }
.t-bom { background: var(--bom-soft); color: var(--bom); } .t-dado { background: var(--dado-soft); color: var(--dado); }
.aviso-l { align-items: flex-start; }
.novo { width: 8px; height: 8px; border-radius: 4px; background: #d97706; display: block; }

/* Botões */
.bt { flex: 1; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); color: var(--fg); font-weight: 650; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.bt:disabled { opacity: .6; }
.bt-pri { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
@media (prefers-color-scheme: dark) { .bt-pri { color: #06251a; } }
.bt-branco { background: #fff; color: #0b7350; border: 0; font-weight: 800; font-size: 15px; min-height: 48px; border-radius: 14px; }
.bt-largo { width: 100%; flex: none; }
.bt-sair { color: var(--mau); }
.bt-ic { width: 44px; min-height: 44px; border: 0; border-radius: 12px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; flex: none; }

/* Caixas da ficha */
.caixa { background: var(--surface); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: 0 1px 2px rgba(15,29,23,.04); }
.caixa h2 { font-size: 15px; font-weight: 700; }
.caixa-cab { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.par { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.par span { color: var(--muted); flex: none; }
.par b { text-align: right; overflow-wrap: anywhere; }
.par .grande { font-size: 16px; }
.fu { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; line-height: 1.4; }
.comentar { display: flex; gap: 8px; }
.comentar input { flex: 1; min-width: 0; min-height: 44px; border: 1px solid var(--line-2); border-radius: 12px; padding: 0 12px; font-size: 16px; background: var(--surface); }
.com { display: flex; flex-direction: column; gap: 3px; padding-top: 10px; border-top: 1px solid var(--line); }
.com small { font-size: 12px; color: var(--muted); }
.com small b { color: var(--fg); }
.com p { font-size: 13.5px; line-height: 1.45; overflow-wrap: anywhere; white-space: pre-wrap; }
.meta { display: flex; flex-direction: column; gap: 6px; }
.meta-l { display: flex; justify-content: space-between; font-size: 13px; }
.meta-l span { color: var(--muted); }
.barra { height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 4px; background: var(--dado); }
.barra i.cheia { background: var(--bom); }
.perfil { display: flex; align-items: center; gap: 14px; }
.perfil div { display: flex; flex-direction: column; gap: 3px; }
.perfil small { color: var(--muted); }
.perfil .av-g { box-shadow: none; }

.nota { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.centro { text-align: center; }
.caixa-nota { background: var(--surface); border-radius: 12px; padding: 10px 12px; }
.caixa-nota.mau { color: var(--mau); background: var(--mau-soft); }
.vazio { text-align: center; padding: 28px 12px; color: var(--muted); font-size: 14px; }

/* Folha de baixo */
.veu { position: fixed; inset: 0; background: rgba(8,17,14,.45); z-index: 20; animation: aparecer .18s ease-out; }
.folha { position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; background: var(--surface); border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 12px; max-height: 80dvh; overflow-y: auto; animation: subir .22s cubic-bezier(.2,.8,.2,1); }
.folha h2 { font-size: 17px; font-weight: 800; }
.opcoes { display: flex; flex-direction: column; gap: 8px; }
.opcao { min-height: 48px; border-radius: 12px; border: 1px solid var(--line-2); background: var(--surface); text-align: left; padding: 0 14px; font-size: 14.5px; font-weight: 600; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .veu, .folha { animation: none; } }

/* Entrar */
.tela-entrar { background: var(--head); color: #fff; }
.entrar { flex: 1; overflow-y: auto; padding: max(48px, env(safe-area-inset-top)) 24px 32px; display: flex; flex-direction: column; gap: 14px; max-width: 440px; width: 100%; margin: 0 auto; }
.entrar-logo { border-radius: 18px; align-self: flex-start; }
.entrar h1 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
.entrar > p { color: var(--head-sub); }
.entrar form { display: flex; flex-direction: column; gap: 14px; margin-top: 8px; }
.entrar label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: #e3f6ee; }
.entrar input { min-height: 50px; border-radius: 12px; border: 0; padding: 0 14px; font-size: 16px; background: #fff; color: #0f1d17; }
.entrar .bt-pri { background: #fff; color: #0b7350; border: 0; min-height: 52px; font-size: 16px; font-weight: 800; margin-top: 4px; }
.entrar .bt:not(.bt-pri) { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.entrar .nota { color: var(--head-sub); }
.erro-txt { background: rgba(255,255,255,.95); color: #b42318; border-radius: 10px; padding: 10px 12px; font-size: 13.5px; font-weight: 600; }

/* Aviso curto */
#aviso { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); z-index: 30; background: #0f1d17; color: #fff; border-radius: 14px; padding: 14px 16px; font-size: 14px; line-height: 1.4; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
#aviso.erro { background: #7f1d1d; }
@media (prefers-color-scheme: dark) { #aviso { background: #e6f2ec; color: #0f1d17; } #aviso.erro { background: #fde4e4; color: #7f1d1d; } }

@media (min-width: 600px) { .tela { max-width: 560px; margin: 0 auto; box-shadow: 0 0 0 1px var(--line); } .nav { max-width: 560px; margin: 0 auto; } }
