:root {
  --bg: #EEF1F5;
  --surface: #FFFFFF;
  --surface-2: #F4F6F9;
  --ink: #16202E;
  --muted: #5C6B7D;
  --faint: #93A0B0;
  --line: #E0E5EC;
  --line-strong: #C9D1DC;
  --accent: #1E5FA8;
  --accent-ink: #FFFFFF;
  --accent-soft: #E4EEF9;
  --ok: #2E9E5B;
  --ok-ink: #FFFFFF;
  --ok-soft: #E3F3E9;
  --bad: #C6483C;
  --shadow: 0 1px 2px rgba(22,32,46,.05), 0 8px 24px rgba(22,32,46,.07);
  --radius: 14px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F151D; --surface: #1A222D; --surface-2: #141B24; --ink: #E9EEF4;
    --muted: #9DABBC; --faint: #647486; --line: #2A333F; --line-strong: #3A4653;
    --accent: #4E93DE; --accent-ink: #0B1017; --accent-soft: #1B2C40;
    --ok: #4FBE7C; --ok-ink: #08130C; --ok-soft: #16301F; --bad: #E58379;
    --shadow: 0 1px 2px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.4);
  }
}

* { box-sizing: border-box; }
/* O JS esconde ficha com o atributo hidden. Sem isto qualquer `display` do
   nosso CSS (a .linha é flex) ganha do [hidden] do navegador e nada some. */
[hidden] { display: none !important; }
html, body { margin: 0; }


body {
  background: var(--bg); color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45; -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
.app { max-width: 620px; margin: 0 auto; padding-bottom: 96px; }

/* ---------- Appbar (azul) ---------- */
.appbar { position: sticky; top: 0; z-index: 20; background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 10px rgba(22,32,46,.12); }
.appbar-row { display: flex; align-items: center; gap: 10px; padding: 16px 16px; }
.appbar .logo { width: 45px; height: 45px; border-radius: 8px; flex: none; display: grid; place-items: center; background: rgba(225,225,225); }
.appbar .logo svg { display: block; }
.appbar-title { font-weight: 800; font-size: 15px; }
.appbar-sub { font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; opacity: .82; margin-top: 1px; }
.appbar-user { margin-left: auto; text-align: right; font-size: 11px; opacity: .95; }
.appbar-user a { color: var(--accent-ink); font-weight: 700; text-decoration: underline; }
.role-badge { font-size: 9px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 999px; background: rgba(255,255,255,.2); }
.back-link {
  display: flex;
  align-items: center;   /* seta e título na mesma linha */
  gap: 12px;
  color: var(--accent-ink);
  text-decoration: none;
  opacity: .95;
}
.back-seta {
  font-size: 3rem;
  line-height: 1;
  flex: none;            /* não deixa a seta encolher */
}

/* ---------- Cabeçalho de página ---------- */
.page-head { padding: 16px 16px 6px; }
.eyebrow { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); font-weight: 700; }
.page-title { font-size: 22px; font-weight: 800; letter-spacing: -.01em; margin: 2px 0; }
.page-sub { font-size: 13px; color: var(--muted); }

.list { padding: 10px 12px; display: flex; flex-direction: column; gap: 10px; }
.empty { text-align: center; color: var(--muted); padding: 34px 24px; font-size: 14px; line-height: 1.6; }

/* ---------- Seção da página (Etapas / Fichas) ---------- */
.secao { padding: 18px 16px 0; border-top: 1px solid var(--line); margin-top: 14px; }
.secao:first-of-type { border-top: 0; margin-top: 0; }
.secao-topo { display: flex; align-items: center; gap: 10px; }
.secao-topo > div { flex: 1; min-width: 0; }
.secao-titulo { font-size: 18px; font-weight: 800; margin: 1px 0 0; }
.secao-sub { font-size: 12.5px; color: var(--muted); margin: 4px 0 0; }
.secao-acoes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn-pequeno { border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 700; border-radius: 10px; padding: 9px 13px; cursor: pointer; }
.btn-pequeno:active { transform: scale(.97); }
.btn-pequeno.destaque { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.bloco-rodape { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 15px; background: var(--surface-2); border-top: 1px solid var(--line); }
.vazio-linha { font-size: 13px; color: var(--faint); padding: 14px 15px; font-style: italic; }

/* ---------- Tipos de local (o que separa o checklist) ---------- */
.tipos-linha { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.chip-tipo { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 6px 6px 6px 12px; }
.chip-tipo small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.chip-tipo.vazio { border-color: var(--bad); }
.chip-tipo.vazio small { color: var(--bad); }
/* O grupo "sem tipo" não é cadastrado, então não tem lápis nem cara de chip. */
.chip-tipo.neutro { color: var(--muted); background: none; border-style: dashed; padding-right: 12px; }
.hint.aviso { margin-top: 8px; color: var(--bad); font-size: 12px; }
.chip-ed { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 12px; line-height: 1; padding: 2px 6px; cursor: pointer; border-radius: 999px; }
.chip-ed:hover { color: var(--accent); }
.tag-tipo { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: 2px; white-space: nowrap; }
.tag-tipo.todas { color: var(--faint); border-style: dashed; }
.dialog-perigo { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); text-align: center; }

/* ---------- Filtros da lista de fichas ---------- */
.filtro { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.filtro label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.filtro select { flex: 1; max-width: 220px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; padding: 9px 11px; }
.filtro select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.tag-torre { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: 2px; }

/* ---------- Pular para a ficha vizinha ---------- */
.nav-fichas { display: flex; gap: 10px; padding: 4px 12px 10px; }
.nav-ficha { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 54px; padding: 0 13px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.nav-ficha.fim { justify-content: flex-end; text-align: right; }
.nav-ficha.oco { background: none; border: 0; box-shadow: none; }
.nav-ficha:active { transform: scale(.98); }
.nav-seta { color: var(--accent); font-size: 22px; line-height: 1; flex: none; }
.nav-texto { min-width: 0; font-size: 14px; font-weight: 700; }
.nav-texto b { display: block; font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* ---------- Card de obra ---------- */
.card-obra { display: flex; align-items: center; gap: 12px; text-decoration: none; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 15px; }
.card-obra:active { transform: scale(.995); }
.card-obra-info { flex: 1; min-width: 0; }
.card-obra-name { font-size: 16px; font-weight: 700; }
.card-obra-meta { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.count-pill { text-align: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 5px 10px; }
.count-pill b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.count-pill span { font-size: 9px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.chev { color: var(--faint); font-size: 20px; }

.card-obra-nc { font-size: 12px; color: var(--bad); font-weight: 700; margin-top: 3px; }

/* ---------- Bloco sanfona (FVS na obra / etapa na ficha) ---------- */
.bloco { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.bloco-head { display: flex; align-items: center; gap: 12px; padding: 14px 15px; cursor: pointer; user-select: none; }
.bloco-head:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.caret { flex: none; color: var(--faint); transition: transform .2s; font-size: 12px; }
.bloco.open .caret { transform: rotate(90deg); }
.bloco-info { flex: 1; min-width: 0; }
.bloco-name { font-size: 15.5px; font-weight: 700; }
.bloco-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.bloco-body { display: none; flex-direction: column; border-top: 1px solid var(--line); }
.bloco.open .bloco-body { display: flex; }

.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; flex: 1; max-width: 150px; }
.bar > i { display: block; height: 100%; background: var(--ok); border-radius: 3px; transition: width .4s; }

.pill { flex: none; font-size: 12px; font-weight: 800; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); min-width: 38px; text-align: center; padding: 4px 9px; border-radius: 999px; }
.pill.done { color: var(--ok); background: var(--ok-soft); border-color: transparent; font-size: 14px; }
.pill.nc { color: var(--bad); background: rgba(198,72,60,.12); border-color: transparent; }

/* ---------- Linha de verificação (um local/peça) ---------- */
.linha { display: flex; align-items: center; gap: 10px; padding: 12px 15px; border-bottom: 1px solid var(--line); text-decoration: none; }
.linha:last-child { border-bottom: 0; }
.linha:active { background: var(--surface-2); }
.linha-info { flex: 1; min-width: 0; }
.linha-titulo { font-size: 14.5px; font-weight: 700; }
.linha-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tag-resp { font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--ok); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; margin-left: 6px; vertical-align: 2px; }
.tag-livre { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); margin-left: 6px; vertical-align: 2px; }
.linha-quem { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.linha-prog { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.linha-count { font-variant-numeric: tabular-nums; }
.tag-nc { color: var(--bad); font-weight: 700; }

/* ---------- Resumo da ficha ---------- */
.resumo { margin: 6px 12px 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 15px; }
.resumo .bar { max-width: none; }
.resumo-txt { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.resumo-txt b { color: var(--ink); font-variant-numeric: tabular-nums; }
.resumo-nc { color: var(--bad); font-weight: 700; }
.resumo-nc.vazio { display: none; }

/* ---------- Item da ficha ---------- */
.item { padding: 14px 15px; border-bottom: 1px solid var(--line); border-left: 4px solid transparent; }
.item:last-child { border-bottom: 0; }
.item.st-c { border-left-color: var(--ok); }
.item.st-nc { border-left-color: var(--bad); }
.item.st-na { border-left-color: var(--line-strong); }
.item-servico { font-size: 14.5px; font-weight: 700; }
.item-verificar { font-size: 13px; color: var(--muted); margin: 4px 0 0; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { font-size: 11.5px; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 4px 9px; }
.chip b { color: var(--muted); font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; display: block; font-weight: 700; }

/* Bolinha de check */
.item.marcavel { display: flex; align-items: flex-start; gap: 12px; }
.item-corpo { flex: 1; min-width: 0; }
.check {
  flex: none; position: relative; width: 30px; height: 30px; border-radius: 50%;
  border: 2px solid var(--line-strong); background: var(--surface); color: transparent;
  cursor: pointer; display: grid; place-items: center; transition: .15s; margin-top: 1px;
}
.check svg { opacity: 0; transition: opacity .12s; }
.check:active { transform: scale(.9); }
.check:disabled { opacity: .5; }
.check::after { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff; }
.item.st-c .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.item.st-c .check svg { opacity: 1; }
.item.st-c .item-servico { color: var(--muted); }
/* estados antigos, quando a ficha ainda registrava NC */
.item.st-nc .check { background: var(--bad); border-color: var(--bad); }
.item.st-nc .check::after { content: "✕"; }
.item.st-na .check { background: var(--line-strong); border-color: var(--line-strong); }
.item.st-na .check::after { content: "–"; color: var(--ink); }
/* Caixa de observação: só aparece no não conforme */
.obs { display: none; margin-top: 9px; }
.item.st-nc .obs { display: block; }
.obs label { font-size: 11.5px; font-weight: 700; color: var(--bad); }
.obs textarea { width: 100%; margin-top: 4px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 13px; padding: 9px 10px; resize: vertical; }
.obs textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.obs-salvar { margin-top: 6px; border: 0; background: var(--accent); color: var(--accent-ink); font: inherit; font-size: 12.5px; font-weight: 700; border-radius: 9px; padding: 8px 14px; cursor: pointer; }
.obs-salvar:disabled { opacity: .5; }

/* Legenda das cores da bolinha */
.legenda { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--muted); }
.legenda span { display: inline-flex; align-items: center; gap: 5px; }
.legenda .bola { width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 800; font-style: normal; color: #fff; flex: none; }
.legenda .bola.c { background: var(--ok); }
.legenda .bola.nc { background: var(--bad); }
.legenda .bola.na { background: var(--line-strong); color: var(--ink); }

.item-assinatura { font-size: 11.5px; color: var(--ok); font-weight: 600; margin-top: 6px; }
.item-assinatura:empty { display: none; }

/* Admin atribuindo serviço por serviço — vários responsáveis por serviço. */
.item-atribuir { margin-top: 7px; }
.item-atribuir.ocupado { opacity: .5; pointer-events: none; }
.chips-resp { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.chip-resp { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 700; color: var(--ok); background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 4px 3px 9px; }
.chip-tirar { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 14px; line-height: 1; padding: 0 4px; cursor: pointer; border-radius: 999px; }
.chip-tirar:hover { color: var(--bad); }
.chip-vazio { font-size: 11.5px; color: var(--faint); font-style: italic; }

/* Escolher vários responsáveis no diálogo do serviço. */
.equipe-check { display: flex; flex-wrap: wrap; gap: 6px; }
.check-pessoa { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 12px; cursor: pointer; }
.check-pessoa input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.check-pessoa:has(input:checked) { border-color: var(--accent); color: var(--accent); }
.item-resp { width: 100%; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 12.5px; font-weight: 600; padding: 7px 9px; }
.item-resp:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

/* O que a pessoa de campo vê: de quem é a tarefa, ou que não é dela. */
.item-tarefa { font-size: 11.5px; font-weight: 700; color: var(--muted); margin-top: 6px; }
.item-tarefa.travado { color: var(--faint); font-weight: 600; }

/* Serviço sem atribuição: aparece, mas não deixa marcar. */
.item.travado .check { opacity: .35; cursor: not-allowed; }
.item.travado .item-servico, .item.travado .item-verificar { opacity: .7; }
.item.travado .obs textarea { opacity: .6; cursor: not-allowed; }

/* Rastro de quem mexeu no serviço — fechado por padrão para não poluir. */
.item-hist { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 8px; }
.item-hist summary { font-size: 11.5px; font-weight: 700; color: var(--muted); cursor: pointer; list-style: none; }
.item-hist summary::-webkit-details-marker { display: none; }
.item-hist summary::before { content: "▸ "; }
.item-hist[open] summary::before { content: "▾ "; }
.item-hist-lista { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.item-hist-lista li { display: flex; flex-wrap: wrap; gap: 2px 8px; font-size: 11.5px; }
.item-hist-lista b { font-weight: 700; }
.item-hist-lista span { color: var(--faint); }
.item.leitura .item-del { margin-top: 10px; }
.item-acoes { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
a.btn-pequeno { display: inline-flex; align-items: center; text-decoration: none; }

/* ---------- Corrigir e excluir ---------- */
.perigo { padding: 4px 16px 8px; text-align: center; }
.link-del { border: 0; background: none; color: var(--bad); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.link-ed { border: 0; background: none; color: var(--accent); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; padding: 2px 0; text-decoration: underline; }

/* ---------- Avisos (messages) ---------- */
.flash-wrap { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; width: min(520px, 92vw); }
.flash { background: var(--ink); color: var(--bg); padding: 11px 16px; border-radius: 12px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); cursor: pointer; }
.flash.erro { background: var(--bad); color: #fff; }
.flash.saindo { opacity: 0; transform: translateY(-8px); transition: .3s; }

/* ---------- Dock + botões ---------- */
.dock { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); max-width: 620px; margin: 0 auto; display: flex; gap: 10px; }
.btn { min-height: 50px; border-radius: 12px; font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; background: var(--surface-2); color: var(--ink); text-decoration: none; padding: 0 18px; }
.btn.wide { width: 100%; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); flex: 1.4; }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-strong); }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; background: var(--surface); color: var(--ink); box-shadow: var(--shadow); width: min(420px, 92vw); }
dialog::backdrop { background: rgba(0,0,0,.45); }
.dialog-body { padding: 18px; display: flex; flex-direction: column; gap: 8px; }
.dialog-body h3 { margin: 0 0 6px; font-size: 18px; }
.dialog-body label { font-size: 12px; color: var(--muted); font-weight: 600; margin-top: 4px; }
.dialog-body input, .dialog-body select, .dialog-body textarea { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); color: var(--ink); font: inherit; padding: 11px; width: 100%; }
.dialog-body textarea { font-size: 13px; resize: vertical; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.dialog-body input:focus, .dialog-body select:focus, .dialog-body textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.dialog-texto { font-size: 12.5px; color: var(--muted); margin: 0 0 6px; line-height: 1.5; }
.hint { font-size: 11.5px; color: var(--faint); margin-top: -2px; }
.opcional { font-size: 10px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; margin-left: 5px; }
.checkline { display: flex; align-items: flex-start; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 10px; line-height: 1.4; }
.checkline input { width: auto; flex: none; margin-top: 2px; }
.dialog-actions { display: flex; gap: 8px; margin-top: 12px; }
.dialog-actions .btn { flex: 1; min-height: 46px; }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-size: 13px; font-weight: 600; opacity: 0; pointer-events: none; transition: .25s; z-index: 50; max-width: 90%; text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.erro { background: var(--bad); color: #fff; }

/* ---------- Login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); padding: 28px 24px; }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.login-brand .logo { width: 34px; height: 34px; border-radius: 9px; background: var(--withe); display: grid; place-items: center; }
.login-brand .logo svg { display: block; }
.brand-name { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--faint); font-weight: 600; margin-top: 1px; }
.login-card h1 { font-size: 19px; margin: 0 0 2px; }
.login-card p.sub { font-size: 13px; color: var(--muted); margin: 0 0 20px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input { border: 1px solid var(--line-strong); border-radius: 11px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: 15px; padding: 12px 13px; }
.field input:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
.login-err { font-size: 13px; color: var(--bad); background: rgba(198,72,60,.12); padding: 10px 12px; border-radius: 10px; margin-bottom: 14px; }
.login-btn { width: 100%; min-height: 50px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.login-foot { font-size: 11.5px; color: var(--faint); margin-top: 16px; text-align: center; line-height: 1.5; }
.logo-img{width: 34px;height: 34px;border-radius: 9px;background: var(--accent);display: grid;place-items: center;}
/* ---------- Responsividade ---------- */
img, svg { max-width: 100%; height: auto; }
body { overflow-x: hidden; }
.card-obra-name, .bloco-name, .linha-titulo, .item-servico, .item-verificar,
.chip, .page-title, .appbar-title { overflow-wrap: anywhere; }
.appbar-title { line-height: 1.2; }

@media (max-width: 400px) {

  .back-seta { font-size: 2.2rem; }
  .back-link { gap: 8px; }
  .appbar-row { gap: 8px; padding: 10px 12px; }
  .appbar .logo { width: 34px; height: 34px; }
  .appbar-user { font-size: 10px; }
  .page-head { padding: 12px 12px 4px; }
  .page-title { font-size: 20px; }
  .list { padding: 8px; }
  .bloco-head, .linha, .item { padding-left: 12px; padding-right: 12px; }
  .dock { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .btn { font-size: 14px; padding: 0 12px; }
  .bar { max-width: 90px; }
  .resumo .bar { max-width: none; }
  .op { font-size: 11.5px; min-height: 42px; }
}

@media (max-width: 480px) {
  .back-seta { font-size: 3rem; }
  .back-link { gap: 8px; }
}
/* telas largas: coluna centralizada com respiro */
@media (min-width: 680px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); min-height: 100vh; }
}

/* ---------- PWA: banner instalar / tutorial ---------- */
.pwa-sheet-wrap { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.pwa-backdrop { position: absolute; inset: 0; background: rgba(10,16,24,.5); opacity: 0; transition: opacity .25s; }
.pwa-sheet-wrap.show .pwa-backdrop { opacity: 1; }
.pwa-sheet {
  position: relative; width: min(480px, 100%); background: var(--surface); color: var(--ink);
  border-radius: 20px 20px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.25);
  padding: 22px 22px calc(24px + env(safe-area-inset-bottom)); text-align: center;
  transform: translateY(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.pwa-sheet-wrap.show .pwa-sheet { transform: translateY(0); }
.pwa-x { position: absolute; top: 12px; right: 14px; border: 0; background: none; color: var(--faint); font-size: 18px; cursor: pointer; line-height: 1; padding: 4px; }
.pwa-logo { display: flex; justify-content: center; margin-bottom: 12px; }
.pwa-logo img { border-radius: 12px; box-shadow: var(--shadow); }
.pwa-title { margin: 0 0 6px; font-size: 18px; font-weight: 800; }
.pwa-text { margin: 0 0 16px; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.pwa-btn { width: 100%; min-height: 50px; border: 0; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 800; font-size: 15px; cursor: pointer; }
.pwa-later { width: 100%; margin-top: 8px; border: 0; background: none; color: var(--muted); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 10px; }
.pwa-steps { text-align: left; margin: 0 0 8px; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; line-height: 1.45; }
.pwa-steps b { font-weight: 700; }
.pwa-ic { display: inline-block; }
.pwa-hint { font-size: 12.5px; color: var(--muted); margin: 4px 0 16px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }


















