/*
 * Identidade visual Tigre Vigilância — mesmos tokens do Tigre SST (apps/web/src/app/globals.css).
 * Vermelho carmim, grafite e branco. Tema claro em :root, escuro em [data-theme='dark'].
 */
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-wght-normal.woff2) format('woff2-variations');
  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; }
@font-face { font-family: 'Inter Variable'; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(../fonts/inter-latin-ext-wght-normal.woff2) format('woff2-variations');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root, [data-theme='light'] {
  --brand: #c8102e; --brand-hover: #9e0b22; --brand-soft: #fde8eb;
  --ink: #131418; --ink-soft: #1d1f25;
  --background: #f6f7f9; --surface: #ffffff; --surface-muted: #f0f1f4; --line: #e3e5ea;
  --fg: #111111; --muted: #5b6170; --focus: #c8102e;
  --ok: #15803d; --ok-soft: #dcfce7; --warn: #b45309; --warn-soft: #fef3c7;
  --bad: #b42318; --bad-soft: #fee4e2; --none: #475467; --none-soft: #eaecf0; --info: #1d4ed8; --info-soft: #dbeafe;
  --sidebar: #131418; --sidebar-hover: #23252c; --sidebar-text: #c9ccd4; --sidebar-active: #ffffff; --sidebar-accent: #e11d3a;
  --radius: 12px; --shadow: 0 1px 2px rgba(16,24,40,.05);
  color-scheme: light;
}
[data-theme='dark'] {
  --brand: #e11d3a; --brand-hover: #f0435c; --brand-soft: #3a1219;
  --ink: #0a0b0d; --ink-soft: #1b1d22;
  --background: #0e0f12; --surface: #17181d; --surface-muted: #1f2127; --line: #2c2f37;
  --fg: #f2f3f5; --muted: #a0a6b4; --focus: #f0435c;
  --ok: #4ade80; --ok-soft: #10291a; --warn: #fbbf24; --warn-soft: #2d230c;
  --bad: #f87171; --bad-soft: #331414; --none: #a0a6b4; --none-soft: #24262c; --info: #60a5fa; --info-soft: #13213a;
  --sidebar: #0a0b0d; --sidebar-hover: #1b1d22;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--background); color: var(--fg); font: 15px/1.5 'Inter Variable', ui-sans-serif, system-ui, sans-serif; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 1rem; font-weight: 700; }
h3 { font-size: .95rem; font-weight: 700; margin: 1.1rem 0 .5rem; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .8em; }
.ico { width: 18px; height: 18px; flex-shrink: 0; }
.ico.p { width: 16px; height: 16px; } .ico.pp { width: 14px; height: 14px; } .ico.g { width: 20px; height: 20px; } .ico.gg { width: 24px; height: 24px; }
.muted { color: var(--muted); }
.carregando, .vazio { color: var(--muted); text-align: center; padding: 2.5rem 1.25rem; margin: 0; }
.txt-ok { color: var(--ok); } .txt-perigo { color: var(--bad); } .txt-alerta { color: var(--warn); } .txt-marca { color: var(--brand); }
[hidden] { display: none !important; }

/* ---------- Estrutura (AppShell do SST) ---------- */
.shell { min-height: 100vh; padding-left: 256px; }
.lateral { position: fixed; inset: 0 auto 0 0; width: 256px; z-index: 30; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; }
.lateral-marca { display: flex; align-items: center; gap: 12px; padding: 20px; text-decoration: none; }
.lateral-marca img { height: 36px; width: auto; }
.lateral-marca small { display: block; font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .25em; color: var(--sidebar-text); }
.lateral-marca strong { display: block; font-size: 1.125rem; font-weight: 800; color: #fff; line-height: 1.2; }
.lateral-grupos { flex: 1; overflow-y: auto; padding: 0 12px 24px; }
.grupo + .grupo { margin-top: 20px; }
.grupo-rotulo { padding: 0 12px 6px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: rgba(201,204,212,.6); margin: 0; }
.grupo ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 8px; font-size: .875rem; font-weight: 500; text-decoration: none; color: var(--sidebar-text); transition: background .15s, color .15s; }
.nav-item:hover { background: var(--sidebar-hover); color: var(--sidebar-active); }
.nav-item.ativo { background: var(--sidebar-hover); color: var(--sidebar-active); }
.nav-item.ativo::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 4px; border-radius: 0 4px 4px 0; background: var(--sidebar-accent); }
.nav-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item i { font-style: normal; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; padding: 1px 6px; }
.lateral .lateral-fechar { display: none; }

.topo { position: sticky; top: 0; z-index: 20; height: 64px; display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(8px); }
.topo-marca { display: none; align-items: center; gap: 8px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.topo-marca img { height: 28px; }
.busca { position: relative; flex: 1; max-width: 28rem; }
.busca .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 16px; height: 16px; }
.busca input { height: 40px; padding-left: 36px; background: var(--background); font-size: .875rem; }
.busca-res { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 4px 0; max-height: 60vh; overflow: auto; }
.busca-res a { display: flex; gap: 10px; align-items: center; padding: 8px 14px; text-decoration: none; font-size: .875rem; }
.busca-res a:hover, .busca-res a.foco { background: var(--surface-muted); }
.busca-res small { color: var(--muted); margin-left: auto; }
.topo-dir { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.btn-ic { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 0; background: none; color: var(--muted); cursor: pointer; text-decoration: none; }
.btn-ic:hover { background: var(--surface-muted); color: var(--fg); }
.btn-ic .contador { position: absolute; right: 2px; top: 2px; min-width: 20px; height: 20px; padding: 0 4px; border-radius: 99px; font-size: 10px; font-weight: 700; line-height: 20px; color: #fff; background: var(--warn); text-align: center; }
.btn-ic .contador.critico { background: var(--brand); }
.conexao { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; font-size: .8rem; font-weight: 600; text-decoration: none; white-space: nowrap; margin-right: 4px; }
.conexao.on { background: var(--ok-soft); color: var(--ok); } .conexao.off { background: var(--bad-soft); color: var(--bad); }
.usuario-menu { position: relative; margin-left: 8px; padding-left: 12px; border-left: 1px solid var(--line); }
.usuario-btn { display: flex; align-items: center; gap: 12px; border: 0; background: none; color: inherit; font: inherit; padding: 4px 8px 4px 4px; border-radius: 8px; cursor: pointer; text-align: left; }
.usuario-btn:hover { background: var(--surface-muted); }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .875rem; font-weight: 700; flex-shrink: 0; }
[data-theme='dark'] .avatar { background: #2c2f37; }
.usuario-nome { font-size: .875rem; line-height: 1.25; }
.usuario-nome b { display: block; max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.usuario-nome span { display: block; color: var(--muted); max-width: 12rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-suspenso { position: absolute; right: 0; top: calc(100% + 8px); width: 240px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,.12); padding: 4px 0; z-index: 50; }
.menu-suspenso a, .menu-suspenso button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 10px 16px; font: inherit; font-size: .875rem; color: inherit; background: none; border: 0; text-decoration: none; cursor: pointer; }
.menu-suspenso a:hover, .menu-suspenso button:hover { background: var(--surface-muted); }
.menu-suspenso .sair { color: var(--bad); }
.menu-suspenso .cab-menu { padding: 12px 16px; border-bottom: 1px solid var(--line); display: none; }
.menu-btn { display: none; }
main { max-width: 80rem; margin: 0 auto; padding: 32px 24px 112px; outline: none; }

/* ---------- Cabeçalho de página ---------- */
.pag-topo { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; }
.pag-topo h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; }
.pag-topo p { margin: 4px 0 0; color: var(--muted); max-width: 60rem; }
.acoes { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.pag-topo .acoes { margin: 0; }
.form .acoes, .modal-corpo > .acoes { margin-top: 8px; justify-content: flex-end; }

/* Destaque grafite (painel e turno) */
.hero { position: relative; overflow: hidden; border-radius: var(--radius); background: var(--ink); color: #fff; padding: 24px 32px; margin-bottom: 24px; }
.hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at right, rgba(200,16,46,.35), transparent 60%); pointer-events: none; }
.hero > * { position: relative; }
.hero-linha { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.hero small { color: rgba(255,255,255,.7); font-size: .875rem; }
.hero h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -.025em; margin-top: 4px; }
.hero p { margin: 4px 0 0; color: rgba(255,255,255,.75); }
.hero .btn.secundario { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.hero .btn.secundario:hover { background: rgba(255,255,255,.1); }
.hero-marca { position: absolute; right: -16px; top: -12px; height: 140px; opacity: .07; pointer-events: none; }

/* ---------- Cards ---------- */
.cartao { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
/* Conteúdo solto dentro do card ganha o respiro do CardBody; título vira cabeçalho do card. */
.cartao > * { margin: 16px 20px; }
.cartao > :first-child { margin-top: 20px; }
.cartao > :last-child { margin-bottom: 20px; }
.cartao > h2, .cartao > .item-cab { margin: 0 !important; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cartao > .tabela-rolagem, .cartao > .lista, .cartao > .alertas, .cartao > .pontos, .cartao > .vazio, .cartao > .cartao-cab, .cartao > .item-lista { margin: 0 !important; }
.item-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.item-cab h2 { margin: 0; }
.item-cab select { width: auto; height: 36px; font-size: .875rem; }
.cartao.destaque { position: relative; background: var(--ink); color: #fff; border-color: var(--ink); }
.cartao.destaque::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at right, rgba(200,16,46,.35), transparent 60%); pointer-events: none; }
.cartao.destaque > * { position: relative; }
.cartao.destaque h2 { font-size: 1.25rem; font-weight: 800; border: 0; padding-bottom: 0; }
.cartao.destaque p { color: rgba(255,255,255,.8); }
.cartao.destaque .btn:not(.primario) { background: transparent; border-color: rgba(255,255,255,.3); color: #fff; }
.cartao.destaque .selo-ok { background: rgba(74,222,128,.15); color: #4ade80; }
.cartao.destaque .selo-perigo { background: rgba(248,113,113,.15); color: #f87171; }
.cartao-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cartao-cab h2 { display: flex; align-items: center; gap: 8px; }
.cartao-cab select { width: auto; height: 36px; }
.cartao-corpo { padding: 20px; }
.cartao > .vazio { padding: 40px 20px; }
.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin-bottom: 24px; }
.grade-2 > .cartao { margin-bottom: 0; }
.grade-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.secao-titulo { display: flex; align-items: center; gap: 8px; font-size: 1.125rem; font-weight: 700; margin: 32px 0 12px; }
.secao-titulo small { font-size: .875rem; font-weight: 400; color: var(--muted); }

/* StatCard */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; margin-bottom: 24px; }
.kpi { position: relative; overflow: hidden; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.kpi::before { content: ""; position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--ink-soft); }
.kpi.ok::before { background: var(--ok); } .kpi.warn::before { background: var(--warn); } .kpi.bad::before { background: var(--bad); }
.kpi-topo { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .875rem; font-weight: 500; }
.kpi strong { display: block; margin-top: 8px; font-size: 1.875rem; font-weight: 800; letter-spacing: -.025em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: 4px; font-size: .875rem; color: var(--muted); }

/* Barra de progresso */
.barra { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.barra-trilho { flex: 1; height: 10px; border-radius: 99px; background: var(--surface-muted); overflow: hidden; }
.barra-trilho span { display: block; height: 100%; background: var(--ok); }
.barra-trilho span.warn { background: var(--warn); } .barra-trilho span.bad { background: var(--bad); }
.barra b { font-size: .875rem; font-weight: 700; width: 3.2rem; text-align: right; font-variant-numeric: tabular-nums; }

/* Semáforo */
.luz { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: 0 0 0 4px var(--surface-muted); flex-shrink: 0; background: var(--ok); }
.luz.warn { background: var(--warn); } .luz.bad { background: var(--bad); } .luz.none { background: var(--none); }

/* ---------- Listas (padrão do plano de ação do SST) ---------- */
.lista { list-style: none; margin: 0; padding: 0; }
.lista > li { border-bottom: 1px solid var(--line); }
.lista > li:last-child { border-bottom: 0; }
.linha { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 12px 20px; text-decoration: none; color: inherit; }
button.linha { width: 100%; border: 0; background: none; font: inherit; text-align: left; cursor: pointer; }
a.linha:hover, button.linha:hover, .linha.clicavel:hover { background: var(--surface-muted); cursor: pointer; }
.linha-corpo { flex: 1; min-width: 0; }
.linha-titulo { font-weight: 600; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.linha-titulo .mono { color: var(--muted); font-weight: 500; }
.linha-meta { font-size: .8rem; color: var(--muted); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.prioridade { font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.prioridade.Crítica, .prioridade.Alta { color: var(--bad); } .prioridade.Média { color: var(--warn); } .prioridade.Baixa { color: var(--muted); }

.item-lista { padding: 16px 20px; border-bottom: 1px solid var(--line); }
.item-lista:last-child { border-bottom: 0; }
.cartao > .item-lista { margin: 0; }
.item-lista > small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.item-lista > p { margin: 8px 0; }

/* Tabelas */
.tabela-rolagem { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { text-align: left; padding: 12px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; font-weight: 600; color: var(--muted); background: var(--surface-muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.clicavel { cursor: pointer; } tr.clicavel:hover td { background: var(--surface-muted); }
.tabela-simples th, .tabela-simples td { padding: 8px 12px; vertical-align: top; }
.nc { color: var(--bad); font-weight: 600; }

/* Selos (StatusBadge / Badge) */
.selo { display: inline-flex; align-items: center; gap: 4px; border-radius: 99px; padding: 2px 10px; font-size: .75rem; font-weight: 600; white-space: nowrap; background: var(--none-soft); color: var(--none); }
.selo .ico { width: 14px; height: 14px; }
.selo-ok { background: var(--ok-soft); color: var(--ok); } .selo-info { background: var(--info-soft); color: var(--info); }
.selo-alerta { background: var(--warn-soft); color: var(--warn); } .selo-perigo { background: var(--bad-soft); color: var(--bad); }
.etiqueta { display: inline-flex; align-items: center; border-radius: 99px; padding: 2px 12px; font-size: .75rem; font-weight: 700; }
.etiqueta.marca { background: var(--brand); color: #fff; } .etiqueta.ink { background: var(--ink-soft); color: #fff; } .etiqueta.suave { background: var(--brand-soft); color: var(--brand); }

/* ---------- Botões e campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 8px; border: 1px solid transparent;
  font: inherit; font-size: .875rem; font-weight: 600; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; background: var(--surface); color: var(--fg); border-color: var(--line); }
.btn:hover { background: var(--surface-muted); }
.btn:disabled { opacity: .5; pointer-events: none; }
.btn .ico { width: 16px; height: 16px; }
.btn.primario { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primario:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.escuro { background: var(--ink-soft); border-color: var(--ink-soft); color: #fff; }
.btn.escuro:hover { background: var(--ink); }
.btn.fantasma { background: none; border-color: transparent; }
.btn.fantasma:hover { background: var(--surface-muted); }
.btn.pequeno { height: 32px; padding: 0 12px; }
.btn.grande { height: 48px; padding: 0 24px; font-size: 1rem; }
.btn.largo { width: 100%; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--brand); cursor: pointer; text-decoration: none; }
.btn-link:hover { text-decoration: underline; }
.form { display: flex; flex-direction: column; gap: 16px; }
.form.estreito { max-width: 36rem; }
label { display: block; font-size: .875rem; font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 6px; }
input, select, textarea { display: block; width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--fg); font: inherit; font-size: 1rem; font-weight: 400; }
select { padding-right: 32px; }
textarea { height: auto; min-height: 96px; padding: 10px 12px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 20%, transparent); }
input::placeholder, textarea::placeholder { color: var(--muted); }
label.check { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 400; cursor: pointer; }
label.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
label.check.simples { border: 0; padding: 0; min-height: 0; background: none; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; margin: 0; display: flex; flex-direction: column; gap: 8px; }
legend { font-size: .875rem; font-weight: 700; padding: 0 4px; }
.dica { font-size: .8rem; color: var(--muted); margin: 0; }
.aviso { display: flex; gap: 8px; align-items: flex-start; border-radius: 8px; padding: 10px 12px; font-size: .875rem; font-weight: 500; background: var(--warn-soft); color: var(--warn); margin: 0; }
.erro-form { display: flex; gap: 8px; align-items: flex-start; border-radius: 8px; padding: 10px 12px; font-size: .875rem; font-weight: 500; background: var(--bad-soft); color: var(--bad); margin: 0; }
.linha-form { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.linha-form input { flex: 1; }
.linha-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; }
.linha-status > span { font-weight: 600; font-size: .875rem; }
.ferramentas { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.ferramentas select { width: auto; min-width: 200px; height: 40px; }
.ferramentas .direita { margin-left: auto; display: flex; gap: 8px; }

/* Abas (sublinhado vermelho, como Lista / Quadro no SST) */
.abas { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; }
.abas button { display: inline-flex; align-items: center; gap: 6px; padding: 10px 12px; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; background: none; font: inherit; font-size: .875rem; font-weight: 600; color: var(--muted); cursor: pointer; white-space: nowrap; }
.abas button:hover { color: var(--fg); }
.abas button.ativo { color: var(--fg); border-bottom-color: var(--brand); }
.segmentado { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmentado button { border: 0; background: none; font: inherit; font-size: .875rem; font-weight: 600; color: var(--muted); padding: 0 14px; height: 38px; cursor: pointer; }
.segmentado button.ativo { background: var(--ink-soft); color: #fff; }
.hero .segmentado { background: transparent; border-color: rgba(255,255,255,.3); }
.hero .segmentado button { color: rgba(255,255,255,.75); }
.hero .segmentado button.ativo { background: var(--brand); color: #fff; }

/* Checklist */
.item-check { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; }
.item-check legend { padding: 0; float: left; width: 100%; margin-bottom: 8px; font-weight: 600; }
.item-check legend + * { clear: both; }
.opcoes-check { display: flex; flex-wrap: wrap; gap: 8px; }
.opcoes-check label { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; font-weight: 600; cursor: pointer; background: var(--surface); }
.opcoes-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.opcoes-check label:has(input[value=ok]:checked) { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.opcoes-check label:has(input[value=nc]:checked) { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
.opcoes-check label:has(input[value=na]:checked) { background: var(--none-soft); border-color: var(--none); }
.nc-extra { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 12px; }
.linha-item { display: grid; grid-template-columns: 1fr 70px auto auto auto; gap: 8px; align-items: center; }
.acoes.fixas { position: sticky; bottom: 16px; justify-content: flex-end; }

/* Atalhos de campo (tela "Em campo" do SST) */
.atalhos { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.atalho { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); text-decoration: none; color: inherit; }
.atalho > .ico { color: var(--brand); width: 24px; height: 24px; }
.atalho div { flex: 1; min-width: 0; }
.atalho b { display: block; font-weight: 700; }
.atalho small { display: block; color: var(--muted); font-size: .875rem; }
.atalho.feito > .ico { color: var(--ok); }
.atalho.bloqueado { opacity: .55; }
.atalho .btn { flex-shrink: 0; }
.lista-check { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.lista-check li { display: flex; align-items: center; gap: 8px; color: var(--bad); font-weight: 600; } .lista-check li.ok { color: var(--ok); }
.pontos { list-style: none; margin: 0; padding: 0; }
.pontos li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.pontos li:last-child { border-bottom: 0; }
.pontos li > div { flex: 1; } .pontos small { display: block; color: var(--muted); font-size: .8rem; }
.pontos li > .ico { color: var(--none); } .pontos li.ok > .ico { color: var(--ok); } .pontos li.alerta > .ico { color: var(--warn); }
.etapas { display: flex; list-style: none; padding: 0; margin: 0 0 20px; gap: 4px; }
.etapas li { flex: 1; text-align: center; font-size: .75rem; font-weight: 600; padding: 6px 4px; border-radius: 6px; background: var(--surface-muted); color: var(--muted); }
.etapas li.feita { background: var(--ink-soft); color: #fff; }
.etapas li.atual { background: var(--brand); color: #fff; }
.etapas.mini { margin: 8px 0 0; } .etapas.mini li { font-size: .7rem; padding: 3px; }
.linha-tempo { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--line); }
.linha-tempo li { position: relative; padding: 2px 0 14px 12px; }
.linha-tempo li::before { content: ""; position: absolute; left: -23px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--surface); }
.linha-tempo p { margin: 4px 0 0; }
.lt-meta { font-size: .8rem; color: var(--muted); margin-left: 6px; }
.adendo { border-left: 3px solid var(--info); background: var(--surface-muted); border-radius: 6px; padding: 8px 12px; margin: 8px 0; }
.adendo p { margin: 4px 0 0; }
.texto { white-space: pre-wrap; }
.detalhes { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0 0 16px; font-size: .9rem; }
.detalhes dt { color: var(--muted); } .detalhes dd { margin: 0; font-weight: 500; }
.panico-ativo { border: 2px solid var(--brand); background: var(--brand-soft); animation: pulso 1.4s infinite; }
@keyframes pulso { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--brand) 18%, transparent); } }

/* Alertas (central do SST) */
.alertas { list-style: none; margin: 0; padding: 0; }
.alertas li { border-bottom: 1px solid var(--line); } .alertas li:last-child { border-bottom: 0; }
.alertas a { display: flex; gap: 12px; align-items: flex-start; padding: 12px 20px; text-decoration: none; }
.alertas a:hover { background: var(--surface-muted); }
.alertas .ico { margin-top: 2px; }
.alerta-critico .ico, .alerta-alto .ico { color: var(--bad); } .alerta-medio .ico { color: var(--warn); } .alerta-lida .ico { color: var(--muted); }
.alertas b { display: block; font-weight: 600; font-size: .9rem; } .alertas span { display: block; font-size: .8rem; color: var(--muted); }
.alerta-critico { background: var(--bad-soft); }

/* Fotos, assinatura, leitor */
.fotos-lista { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.fotos-lista:empty { display: none; }
.miniatura { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-muted); }
.assinatura { border: 1px solid var(--line); border-radius: 8px; padding: 10px; background: var(--surface-muted); }
.assinatura-topo { display: flex; justify-content: space-between; font-size: .875rem; font-weight: 600; margin-bottom: 6px; }
.assinatura canvas { display: block; width: 100%; background: #fff; border: 1px dashed #b8bcc6; border-radius: 6px; touch-action: none; }
.ass { display: flex; flex-wrap: wrap; gap: 16px; }
.ass figure { margin: 0; text-align: center; }
.ass img { width: 220px; height: 90px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.ass figcaption { font-size: .8rem; color: var(--muted); }
.leitor-video { width: 100%; max-height: 300px; border-radius: 8px; background: #000; }
.demo summary { cursor: pointer; font-size: .875rem; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); color: var(--fg); border-radius: 99px; padding: 5px 12px; font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; }
.chip:hover { border-color: var(--brand); color: var(--brand); }

/* Mapa */
.mapa { display: block; width: 100%; border-radius: 8px; background: var(--surface-muted); }
.m-grade line { stroke: var(--line); stroke-width: 1; }
.m-linha { fill: none; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.m-trajeto { stroke: var(--brand); opacity: .75; }
.m-rota { stroke: var(--muted); stroke-dasharray: 10 8; stroke-width: 2; opacity: .6; }
.m-posto { fill: var(--ink); stroke: #fff; stroke-width: 3; }
[data-theme='dark'] .m-posto { fill: #fff; stroke: var(--ink); }
.m-ponto { fill: var(--surface); stroke: var(--muted); stroke-width: 2.5; }
.m-lido { fill: var(--ok); stroke: var(--surface); stroke-width: 2; }
.m-vspp { fill: var(--brand); stroke: #fff; stroke-width: 2.5; }
.m-inspetor { fill: var(--info); stroke: #fff; stroke-width: 3; }
.m-panico { fill: #ff2a45; stroke: #fff; stroke-width: 3; }
.m-rotulo { font-size: 17px; font-weight: 600; fill: var(--fg); paint-order: stroke; stroke: var(--surface-muted); stroke-width: 4px; }
.legenda { display: flex; flex-wrap: wrap; gap: 14px; font-size: .75rem; color: var(--muted); margin-top: 8px; }
.legenda span { display: inline-flex; align-items: center; gap: 5px; }
.legenda i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.lg-posto { background: var(--fg); } .lg-ponto { border: 2px solid var(--muted); } .lg-lido { background: var(--ok); }
.lg-vspp { background: var(--brand); border-radius: 3px !important; } .lg-inspetor { background: var(--info); } .lg-panico { background: #ff2a45; }

/* Janela (Dialog do SST) */
.modal-fundo { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.5); }
.modal { display: flex; flex-direction: column; width: min(36rem, 92vw); max-height: 90vh; background: var(--surface); color: var(--fg); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(0,0,0,.3); }
.modal.largo { width: min(56rem, 92vw); }
.modal header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal header h2 { font-size: 1.125rem; font-weight: 700; }
.modal-corpo { flex: 1; overflow-y: auto; padding: 20px; }
.modal-corpo > p:first-child { margin-top: 0; }
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(28rem, calc(100% - 32px)); }
.toast { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; background: var(--ink-soft); color: #fff; font-size: .9rem; font-weight: 500; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.toast .ico { margin-top: 1px; color: #4ade80; } .toast-erro .ico { color: #f87171; } .toast-alerta .ico { color: #fbbf24; } .toast-info .ico { color: #60a5fa; }

/* Pânico */
.fab-panico { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px; border: 0; border-radius: 99px;
  background: var(--brand); color: #fff; font: inherit; font-weight: 800; letter-spacing: .06em; box-shadow: 0 8px 24px color-mix(in srgb, var(--brand) 45%, transparent); cursor: pointer; }
.fab-panico:hover { background: var(--brand-hover); }

/* ---------- Acesso (AuthLayout do SST) ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh; }
.login-marca { position: relative; overflow: hidden; background: #131418; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; }
.login-marca::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at right, rgba(200,16,46,.35), transparent 60%); }
.login-marca > * { position: relative; }
.login-marca .sobretitulo { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .3em; color: rgba(255,255,255,.6); margin: 0; }
.login-marca img { display: block; width: 100%; max-width: 28rem; margin: 0 auto; }
.login-marca p { margin: 0; max-width: 28rem; color: rgba(255,255,255,.7); }
.login-form { display: flex; align-items: center; justify-content: center; background: var(--background); padding: 40px 32px; }
.login-caixa { width: 100%; max-width: 28rem; }
.login-caixa h1 { font-size: 1.875rem; font-weight: 800; letter-spacing: -.025em; }
.login-caixa > p { margin: 8px 0 32px; color: var(--muted); }
.login-caixa input, .login-caixa select { background: #e8f0fe; border-color: var(--line); }
[data-theme='dark'] .login-caixa input, [data-theme='dark'] .login-caixa select { background: var(--surface); }
.login-caixa .dica { text-align: center; margin-top: 16px; font-size: .875rem; }
.login-logo-movel { display: none; align-items: center; gap: 12px; margin-bottom: 32px; font-size: 1.25rem; font-weight: 800; }
.login-logo-movel img { height: 40px; }
.status-conexao { display: flex; justify-content: center; margin-top: 16px; }

.so-escuro { display: none; }
[data-theme='dark'] .so-claro { display: none; } [data-theme='dark'] .so-escuro { display: inline; }

/* ---------- Responsivo ---------- */
@media (max-width: 1023px) {
  .shell { padding-left: 0; }
  .lateral { width: 288px; max-width: 85vw; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 40px rgba(0,0,0,.4); }
  body.menu-aberto .lateral { transform: none; }
  body.menu-aberto::after { content: ""; position: fixed; inset: 0; z-index: 25; background: rgba(0,0,0,.5); }
  .lateral .lateral-fechar { display: inline-flex; position: absolute; right: 12px; top: 18px; color: #fff; }
  .lateral-fechar:hover { background: rgba(255,255,255,.1); color: #fff; }
  .menu-btn, .topo-marca { display: inline-flex; }
  .login { grid-template-columns: 1fr; }
  .login-marca { display: none; }
  .login-logo-movel { display: flex; }
}
@media (max-width: 767px) {
  .usuario-nome, .usuario-btn > .ico { display: none; }
  .menu-suspenso .cab-menu { display: block; }
  .grade-2 { grid-template-columns: 1fr; }
  .conexao b { display: none; }
}
@media (max-width: 639px) {
  .topo { padding: 0 16px; }
  .busca { display: none; }
  main { padding: 24px 16px 112px; }
  .pag-topo h1, .hero h1 { font-size: 1.5rem; }
  .hero { padding: 24px; }
  .modal-fundo { padding: 0; }
  .modal, .modal.largo { width: 100%; height: 100%; max-height: none; border-radius: 0; border: 0; }
  .detalhes { grid-template-columns: 1fr; gap: 2px; } .detalhes dd { margin-bottom: 8px; }
  th, td { padding: 10px 14px; }
  .linha { padding: 12px 16px; }
  .linha-item { grid-template-columns: 1fr 60px; }
  .kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .kpi { padding: 16px; } .kpi strong { font-size: 1.5rem; }
  .ferramentas select { min-width: 0; flex: 1; }
}
@media print { .lateral, .topo, .fab-panico { display: none; } .shell { padding: 0; } }

/* ================= Inspeção de campo ================= */
a.kpi-link { text-decoration: none; color: inherit; display: block; }
a.kpi-link:hover { border-color: var(--brand); }
.nota { font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 3.2rem; text-align: right; }
button.atalho.largo-btn { width: 100%; font: inherit; color: inherit; text-align: left; cursor: pointer; }
button.atalho.largo-btn:hover { border-color: var(--brand); }
.progresso-hero { margin-top: 16px; max-width: 32rem; }
.progresso-hero .barra-trilho { background: rgba(255,255,255,.15); }
.progresso-hero .barra b { color: #fff; width: auto; }
.hero .selo { background: rgba(255,255,255,.12); color: #fff; }
.hero .selo-ok { background: rgba(74,222,128,.18); color: #4ade80; }
.hero .selo-perigo { background: rgba(248,113,113,.18); color: #fca5a5; }
.hero .selo-alerta { background: rgba(251,191,36,.18); color: #fcd34d; }
.cartao-corpo.itens { display: flex; flex-direction: column; gap: 12px; }
.item-check.critico { border-left: 4px solid var(--brand); }
.item-check .etiqueta { margin-left: 6px; vertical-align: 1px; }
.opcoes-check label { flex: 1 1 auto; justify-content: center; min-width: 96px; height: 48px; }
.barra-final { bottom: 12px; z-index: 10; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.12); }
.salvo { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--ok); transition: opacity .3s; opacity: .75; }
.salvo.pulso { opacity: 1; }
.destaque-assinatura { border: 2px solid var(--ink-soft); }
[data-theme='dark'] .destaque-assinatura { border-color: var(--line); }

/* Fotos */
.fotos { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.foto-item { position: relative; margin: 0; }
.foto-remover { position: absolute; top: -6px; right: -6px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--bad); color: #fff; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.sem-imagem { display: inline-flex; align-items: center; justify-content: center; text-align: center; font-size: .7rem; color: var(--muted); padding: 4px; }
.miniatura.sem-imagem { width: 96px; height: 72px; }
.galeria { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.galeria figure { margin: 0; }
.galeria figcaption { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.foto-btn { padding: 0; border: 0; background: none; cursor: zoom-in; display: block; }
.foto-grande { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; background: var(--surface-muted); }
.foto-ampliada { display: block; width: 100%; max-height: 75vh; object-fit: contain; border-radius: 8px; background: #000; }
.ass-vazia { width: 220px; height: 90px; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line); border-radius: 8px; color: var(--muted); font-size: .8rem; }

/* Checklist no relatório */
.secao-check { border-top: 1px solid var(--line); }
.secao-check summary { padding: 12px 20px; font-weight: 700; cursor: pointer; background: var(--surface-muted); }
.lista-itens { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.senha-temp { font-family: ui-monospace, Consolas, monospace; font-size: 1.6rem; font-weight: 800; letter-spacing: .08em; text-align: center; padding: 16px; border-radius: 8px; background: var(--surface-muted); }

/* Mapa da inspeção */
.m-local { fill: var(--ink); stroke: #fff; stroke-width: 3; }
[data-theme='dark'] .m-local { fill: #fff; stroke: var(--ink); }
.m-inicio, .m-fim { fill: var(--info); stroke: #fff; stroke-width: 3; }
.m-foto { fill: var(--ok); stroke: var(--surface); stroke-width: 2; }
.m-nc { fill: var(--brand); stroke: #fff; stroke-width: 2; }
.m-escala { font-size: 14px; fill: var(--muted); }
.lg-local { background: var(--fg); border-radius: 2px !important; } .lg-inicio { background: var(--info); } .lg-foto { background: var(--ok); } .lg-nc { background: var(--brand); }

@media (max-width: 639px) {
  .barra-final { flex-wrap: nowrap; }
  .barra-final .btn.grande { flex: 1; padding: 0 12px; }
  .barra-final .salvo { display: none; }
  .hero .btn.grande { width: 100%; }
  .galeria { grid-template-columns: 1fr 1fr; }
  .lista .linha .linha-corpo { flex-basis: calc(100% - 40px); }
  .lista .linha .nota { min-width: 0; margin-left: 30px; }
  .atalho { flex-wrap: wrap; }
  .atalho div { flex-basis: calc(100% - 40px); }
  .atalho > .btn { width: 100%; }
  .opcoes-check { flex-wrap: nowrap; gap: 6px; }
  .opcoes-check label { min-width: 0; flex: 1 1 0; padding: 0 6px; gap: 4px; font-size: .8rem; text-align: center; line-height: 1.1; }
  .cartao-corpo { padding: 16px; }
  .item-check { padding: 12px; }
}

/* ================= Mapa com geolocalização ================= */
.mapa-real { width: auto; border-radius: 10px; overflow: hidden; border: 1px solid var(--line); background: #d9dce3; z-index: 0; position: relative; }
.mapa-real .leaflet-control-attribution { font-size: 10px; }
.mapa-ctl { display: flex; gap: 6px; align-items: center; }
.mapa-ctl .segmentado { box-shadow: 0 2px 8px rgba(0,0,0,.25); border: 0; }
.mapa-ctl .segmentado button { height: 32px; padding: 0 12px; font-size: .8rem; background: #fff; color: #333; }
.mapa-ctl .segmentado button.ativo { background: var(--ink-soft); color: #fff; }
.mapa-btn { width: 32px; height: 32px; border: 0; border-radius: 8px; background: #fff; color: #333; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.mapa-aviso { position: absolute; left: 10px; bottom: 22px; right: 10px; z-index: 500; display: flex; gap: 6px; align-items: center; padding: 6px 10px; border-radius: 8px; background: rgba(19,20,24,.85); color: #fff; font-size: .75rem; font-weight: 600; pointer-events: none; }
.mk { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: 50%; border: 2.5px solid #fff; color: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.45); }
.mk .ico { color: #fff; }
.mk-local, .mk-ok, .mk-warn, .mk-bad, .mk-none { border-radius: 8px 8px 8px 0; transform: rotate(-45deg); }
.mk-local .ico, .mk-ok .ico, .mk-warn .ico, .mk-bad .ico, .mk-none .ico { transform: rotate(45deg); }
.mk-local { background: #131418; } .mk-ok { background: #15803d; } .mk-warn { background: #d97706; } .mk-bad { background: #c8102e; } .mk-none { background: #6b7280; }
.mk-inicio, .mk-fim { background: #1d4ed8; } .mk-foto { background: #15803d; } .mk-nc { background: #c8102e; }
.mk-voce { background: #2563eb; box-shadow: 0 0 0 6px rgba(37,99,235,.3); animation: voce 1.8s infinite; }
@keyframes voce { 50% { box-shadow: 0 0 0 12px rgba(37,99,235,.08); } }
.mk-rotulo { position: absolute; left: calc(100% + 6px); top: 2px; white-space: nowrap; font: 700 12px/1.2 'Inter Variable', system-ui, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000, 0 1px 2px #000; pointer-events: none; }
.mk-mini { display: inline-flex; width: 12px; height: 12px; border-width: 2px; box-shadow: none; vertical-align: -1px; }
.mk-mini.mk-local, .mk-mini.mk-ok, .mk-mini.mk-warn, .mk-mini.mk-bad, .mk-mini.mk-none { border-radius: 3px 3px 3px 0; }
.mc-raio { fill: #c8102e; fill-opacity: .08; stroke: #ff5c74; stroke-width: 2; stroke-dasharray: 8 6; }
.mc-precisao { fill: #2563eb; fill-opacity: .12; stroke: #2563eb; stroke-width: 1; stroke-opacity: .5; }
.mt-trajeto { fill: none; stroke: #1d4ed8; stroke-width: 3; stroke-dasharray: 2 7; stroke-linecap: round; }
.legenda-mapa { margin-top: 10px; }
.legenda-mapa .lg-raio { width: 14px; height: 14px; border-radius: 50%; border: 2px dashed #ff5c74; background: rgba(200,16,46,.08); }
.legenda-mapa .lg-trajeto { width: 18px; height: 0; border-top: 3px dotted #1d4ed8; border-radius: 0; }
.leaflet-popup-content { margin: 12px 14px; font: 13px/1.4 'Inter Variable', system-ui, sans-serif; }
.mk-pop { display: flex; flex-direction: column; gap: 4px; min-width: 170px; }
.mk-pop img { width: 100%; max-width: 230px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; background: #eee; }
.mk-pop small { color: #5b6170; }
.mk-pop .btn { margin-top: 6px; color: #fff; }

/* ================= Ditado por voz ================= */
.campo-ditado { position: relative; }
.campo-ditado textarea { padding-right: 56px; }
.btn-microfone { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--brand); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
label > .campo-ditado { margin-top: 6px; }
label > .campo-ditado textarea { margin-top: 0; }
.btn-microfone:hover { border-color: var(--brand); }
.btn-microfone.ativo { background: var(--brand); color: #fff; border-color: var(--brand); animation: pulso 1.4s infinite; }
.ditado-ouvindo { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: .8rem; font-weight: 600; color: var(--brand); }
.ditado-pulso { width: 10px; height: 10px; border-radius: 50%; background: var(--brand); animation: voce 1.2s infinite; flex-shrink: 0; }

/* ================= Ocorrências e não conformidades ================= */
.tipo-oc { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0; background: var(--warn-soft); color: var(--warn); }
.tipo-oc.nc { background: var(--bad-soft); color: var(--bad); }
.escolha-tipo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.opcao-tipo { position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 2px solid var(--line); border-radius: var(--radius); cursor: pointer; font-weight: 400; background: var(--surface); }
.opcao-tipo input { position: absolute; opacity: 0; pointer-events: none; }
.opcao-tipo > .ico { color: var(--muted); margin-top: 2px; }
.opcao-tipo b { display: block; font-size: 1rem; }
.opcao-tipo small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.opcao-tipo:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opcao-tipo:has(input:checked) > .ico { color: var(--brand); }
.opcao-tipo:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.grade-acion { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.mini-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.mini-kpis > div { border: 1px solid var(--line); border-left: 4px solid var(--ink-soft); border-radius: 8px; padding: 10px 12px; }
.mini-kpis > div.warn { border-left-color: var(--warn); } .mini-kpis > div.bad { border-left-color: var(--bad); }
.mini-kpis span { display: block; font-size: .75rem; color: var(--muted); font-weight: 600; }
.mini-kpis b { display: block; font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.mini-kpis small { color: var(--muted); font-size: .75rem; }
.solucao { margin-top: 16px; padding: 12px 14px; border-radius: 8px; background: var(--ok-soft); color: var(--fg); }
.solucao > b { color: var(--ok); display: flex; align-items: center; gap: 6px; }
.solucao p { margin: 6px 0 10px; }
.cartao-pendente { border-style: dashed; }
.tratamento-nc { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 0; }
.mk-ocorrencia { background: #d97706; }
@media (max-width: 639px) {
  .escolha-tipo { grid-template-columns: 1fr; }
  .hero .acoes { width: 100%; }
}
@media (max-width: 1100px) { .grade-2 { grid-template-columns: 1fr; } }
