:root {
  --bg: #f4f6f9; --card: #fff; --text: #1d2433; --muted: #667085; --line: #e3e7ee;
  --primary: #1f5eff; --primary-dark: #1647c7; --ok: #12805c; --warn: #b54708; --danger: #c0262d;
  --radius: 12px; --on-primary: #fff; --realce: #eef3ff; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#0f1420; --card:#171e2c; --text:#e7ebf3; --muted:#98a2b3; --line:#283244;
          --primary:#5b8cff; --primary-dark:#7aa2ff; --shadow:none; --realce:#1c2740; --logo-fundo:#ffffff; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
       background: var(--bg); color: var(--text); }
a { color: var(--primary); text-decoration: none; }
h1 { font-size: 1.35rem; margin: 0; }
h2 { font-size: 1.05rem; margin: 0 0 .75rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* Layout */
.topbar { position: sticky; top: 0; z-index: 10; background: var(--card); border-bottom: 1px solid var(--line);
          display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem; }
.brand { font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topnav { display: none; gap: .25rem; flex: 1; }
.topnav a { padding: .45rem .75rem; border-radius: 8px; color: var(--muted); font-weight: 500; }
.topnav a.ativo, .topnav a:hover { background: var(--bg); color: var(--text); }
.topbar .user { margin-left: auto; display: flex; align-items: center; gap: .5rem; }
main { max-width: 1100px; margin: 0 auto; padding: 1rem 1rem 6rem; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: var(--card);
             border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; text-align: center; padding: .5rem 0 .45rem; font-size: .72rem; color: var(--muted); }
.bottomnav a span { display: block; font-size: 1.25rem; line-height: 1.2; }
.bottomnav a.ativo { color: var(--primary); }
@media (min-width: 820px) {
  .topnav { display: flex; }
  .bottomnav { display: none; }
  main { padding-bottom: 2rem; }
}

.cabecalho { display: flex; align-items: center; justify-content: space-between; gap: .75rem;
             flex-wrap: wrap; margin-bottom: 1rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
        box-shadow: var(--shadow); padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (min-width: 820px) { .grid-2 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); } }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .85rem 1rem;
        color: var(--text); display: block; }
.stat b { display: block; font-size: 1.6rem; line-height: 1.1; }
.stat span { color: var(--muted); font-size: .85rem; }

/* Listas em cartões (funcionam bem no celular) */
.lista { list-style: none; margin: 0; padding: 0; }
.lista li { border-bottom: 1px solid var(--line); }
.lista li:last-child { border-bottom: 0; }
.lista a.item { display: flex; gap: .75rem; align-items: center; padding: .75rem .25rem; color: var(--text); }
.lista a.item:hover { background: var(--bg); }
.item .principal { flex: 1; min-width: 0; }
.item .titulo { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vazio { text-align: center; color: var(--muted); padding: 2rem 1rem; }

/* Etiquetas */
.tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px;
       background: var(--bg); color: var(--muted); white-space: nowrap; }
.st-ABERTO { background: #e0eaff; color: #1f45b0; }
.st-EM_ANDAMENTO { background: #fff1d6; color: #93550b; }
.st-AGUARDANDO { background: #efe5ff; color: #6131b5; }
.st-CONCLUIDO { background: #dcf5ea; color: #0d6b4c; }
.st-CANCELADO { background: #eceff3; color: #5b6576; }
.pr-URGENTE { background: #fde2e2; color: #a2161c; }
.pr-ALTA { background: #ffe7d4; color: #a23e07; }
.pr-MEDIA { background: #eceff3; color: #475467; }
.pr-BAIXA { background: #eceff3; color: #7a8394; }
.ch-ENVIADO { background: #dcf5ea; color: #0d6b4c; }
.ch-SIMULADO { background: #fff1d6; color: #93550b; }
.ch-ERRO { background: #fde2e2; color: #a2161c; }
@media (prefers-color-scheme: dark) { .tag { filter: saturate(.9) brightness(.95); } }

/* Formulários */
form .campo { margin-bottom: .9rem; }
label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search],
input[type=datetime-local], input[type=date], select, textarea {
  width: 100%; font: inherit; font-size: 16px; /* 16px evita zoom no iPhone */
  padding: .6rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
.linha { display: grid; gap: 0 1rem; }
@media (min-width: 640px) { .linha { grid-template-columns: 1fr 1fr; } }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 500; margin-bottom: .5rem; }
.check input { width: 1.1rem; height: 1.1rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; font: inherit; font-weight: 600;
       padding: .6rem 1rem; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--text);
       cursor: pointer; min-height: 42px; }
.btn-primario { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primario:hover { background: var(--primary-dark); }
.btn-perigo { color: var(--danger); }
.btn-bloco { width: 100%; }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; padding: .25rem; }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; }
.filtros { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filtros select, .filtros input { width: auto; flex: 1 1 140px; }

/* Mensagens */
.flash { padding: .7rem 1rem; border-radius: 10px; margin-bottom: 1rem; font-weight: 500; }
.flash-ok { background: #dcf5ea; color: #0d6b4c; }
.flash-erro { background: #fde2e2; color: #a2161c; }

dl.dados { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 0; }
dl.dados dt { color: var(--muted); }
dl.dados dd { margin: 0; overflow-wrap: anywhere; }
.historico { list-style: none; padding: 0; margin: 0; }
.historico li { border-left: 3px solid var(--line); padding: .25rem 0 .75rem .75rem; white-space: pre-line; }
.historico li .quando { color: var(--muted); font-size: .8rem; white-space: normal; }
.descricao { white-space: pre-wrap; overflow-wrap: anywhere; }
.copiar { display: flex; gap: .5rem; }
.copiar input { flex: 1; }

/* Telas de login/cadastro */
.auth { max-width: 460px; margin: 2rem auto; }
.auth .logo { text-align: center; font-size: 2.2rem; }
.auth h1 { text-align: center; margin-bottom: 1rem; }
table.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.tabela th, table.tabela td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.tabela-wrap { overflow-x: auto; }
.so-desktop { display: none; }
@media (min-width: 820px) { .so-desktop { display: inline; } }

/* Gestão */
.atalhos { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .atalhos { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .atalhos { grid-template-columns: 1fr 1fr 1fr; } }
.atalho { display: grid; grid-template-columns: 2.5rem 1fr; grid-template-rows: auto auto; column-gap: .75rem;
          background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; color: var(--text); }
.atalho:hover { border-color: var(--primary); }
.atalho .ico { grid-row: span 2; font-size: 1.6rem; line-height: 2.5rem; text-align: center; }
.atalho span:last-child { color: var(--muted); font-size: .85rem; }
.avatar { width: 2.4rem; height: 2.4rem; border-radius: 50%; background: var(--bg); color: var(--primary);
          display: grid; place-items: center; font-weight: 700; flex: none; }
.sub-h { font-size: .9rem; margin: 1rem 0 .4rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
button[disabled] { opacity: .5; cursor: not-allowed; }

/* Assinatura / plataforma */
.flash-aviso { background: #fff1d6; color: #7a4508; }
.flash-aviso a { color: inherit; font-weight: 700; text-decoration: underline; }
.topbar-plataforma { border-bottom: 3px solid var(--primary); }
.st-TESTE { background: #e0eaff; color: #1f45b0; }
.st-ATIVA { background: #dcf5ea; color: #0d6b4c; }
.st-SUSPENSA { background: #fde2e2; color: #a2161c; }
.st-BLOQ { background: #fde2e2; color: #a2161c; }
.st-CORTESIA { background: #efe5ff; color: #6131b5; }
.planos { display: grid; gap: .75rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .planos { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } }
.plano { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; background: var(--card);
         display: flex; flex-direction: column; gap: .35rem; }
.plano.atual { border: 2px solid var(--primary); }
.plano .preco { font-size: 1.5rem; font-weight: 700; }
.plano .preco small { font-size: .85rem; font-weight: 500; color: var(--muted); }
.plano form { margin-top: auto; }
.instrucoes { white-space: pre-wrap; background: var(--bg); border-radius: 10px; padding: .75rem 1rem; }
.bloqueio { text-align: center; padding: 1.5rem 1rem; }
.bloqueio .ico { font-size: 2.5rem; }

/* Máscaras / validação de campos */
input.invalido { border-color: var(--danger); outline-color: var(--danger); }
.msg-campo { color: var(--danger); font-size: .82rem; margin-top: .25rem; min-height: 0; }
.msg-campo:empty { display: none; }

/* Dicas (hints) nos campos */
.com-dica { position: relative; }
.dica { display: inline-grid; place-items: center; width: 1.05rem; height: 1.05rem; margin-left: .3rem; border-radius: 50%;
        background: var(--bg); border: 1px solid var(--line); color: var(--muted); font-size: .7rem; font-weight: 700;
        cursor: help; vertical-align: 1px; user-select: none; }
.dica-balao { position: absolute; left: 0; width: max(100%, 250px); max-width: min(340px, 90vw); bottom: calc(100% - .2rem); z-index: 20; pointer-events: none;
              background: #1d2433; color: #fff; font-size: .82rem; font-weight: 400; line-height: 1.4;
              padding: .55rem .7rem; border-radius: 8px; box-shadow: 0 6px 18px rgba(0,0,0,.18);
              opacity: 0; transform: translateY(4px); transition: opacity .15s, transform .15s; visibility: hidden; }
.dica-balao::after { content: ""; position: absolute; top: 100%; left: 1rem; border: 6px solid transparent; border-top-color: #1d2433; }
.com-dica:hover > .dica-balao, .com-dica:hover > label > .dica-balao,
.com-dica:has(.dica:focus) .dica-balao { opacity: 1; transform: none; visibility: visible; }
.com-dica:hover .dica, .dica:focus { color: var(--primary); border-color: var(--primary); outline: none; }
@media (prefers-color-scheme: dark) { .dica-balao { background: #e7ebf3; color: #171e2c; }
  .dica-balao::after { border-top-color: #e7ebf3; } }

/* Alternar Lista / Kanban */
.alternar { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--card); }
.alternar a { padding: .5rem .85rem; color: var(--muted); font-weight: 600; font-size: .9rem; min-height: 42px; display: flex; align-items: center; }
.alternar a + a { border-left: 1px solid var(--line); }
.alternar a.ativo { background: var(--primary); color: var(--on-primary); }

/* Quadro Kanban */
.kanban-ajuda { margin-top: -.25rem; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 1fr); gap: .85rem;
          overflow-x: auto; padding-bottom: .75rem; scroll-snap-type: x mandatory; align-items: start; }
@media (max-width: 819px) { .kanban { grid-auto-columns: 82%; margin: 0 -1rem; padding: 0 1rem .75rem; } }
.kb-coluna { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); scroll-snap-align: start;
             display: flex; flex-direction: column; max-height: calc(100vh - 230px); min-height: 160px; transition: background .15s, border-color .15s; }
@media (max-width: 819px) { .kb-coluna { max-height: none; } }
.kb-coluna > header { display: flex; justify-content: space-between; align-items: center; padding: .7rem .85rem;
                      font-weight: 700; border-bottom: 3px solid var(--line); }
.kb-ABERTO > header { border-bottom-color: #4f7cff; }
.kb-EM_ANDAMENTO > header { border-bottom-color: #e3a008; }
.kb-AGUARDANDO > header { border-bottom-color: #8b5cf6; }
.kb-CONCLUIDO > header { border-bottom-color: #12805c; }
.kb-cont { background: var(--card); border: 1px solid var(--line); border-radius: 999px; font-size: .8rem; padding: 0 .55rem; color: var(--muted); }
.kb-cards { padding: .6rem; display: flex; flex-direction: column; gap: .55rem; overflow-y: auto; flex: 1; }
.kb-coluna.alvo { background: var(--realce); border-color: var(--primary); border-style: dashed; }
.kb-vazio { display: none; text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 0; }
.kb-cards:not(:has(.kb-card)) .kb-vazio { display: block; }
.kb-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid #c7ccd6; border-radius: 10px;
           box-shadow: var(--shadow); cursor: grab; transition: opacity .15s, transform .15s; }
.kb-card:hover { border-color: #b8c3dc; }
.kb-card.arrastando { opacity: .45; transform: rotate(1.5deg); }
.kb-card.salvando { opacity: .6; pointer-events: none; }
.pr-borda-URGENTE { border-left-color: #d92d20; }
.pr-borda-ALTA { border-left-color: #f79009; }
.pr-borda-MEDIA { border-left-color: #4f7cff; }
.pr-borda-BAIXA { border-left-color: #c7ccd6; }
.kb-link { display: block; padding: .6rem .7rem .3rem; color: var(--text); }
.kb-num { color: var(--muted); font-size: .75rem; }
.kb-tit { font-weight: 600; line-height: 1.3; margin: .1rem 0; overflow-wrap: anywhere; }
.kb-cli { color: var(--muted); font-size: .85rem; }
.kb-card footer { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; padding: .3rem .7rem .55rem; }
.kb-resp { margin-left: auto; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--bg); color: var(--primary);
           display: grid; place-items: center; font-size: .75rem; font-weight: 700; border: 1px solid var(--line); }
.kb-mover { width: 2.9rem; flex: none; min-width: 0; padding: .1rem .3rem; font-size: 14px; border-radius: 8px; height: 1.8rem; color: var(--muted); cursor: pointer; }
.kb-toast { position: fixed; left: 50%; bottom: 5.5rem; transform: translate(-50%, 20px); background: #1d2433; color: #fff;
            padding: .6rem 1rem; border-radius: 10px; font-size: .9rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: 90vw; }
.kb-toast.visivel { opacity: 1; transform: translate(-50%, 0); }
.kb-toast.erro { background: var(--danger); }
@media (min-width: 820px) { .kb-toast { bottom: 1.5rem; } }
.kb-resp.sem { color: var(--muted); border-style: dashed; }

/* Sino de avisos */
.sino { position: relative; }
.sino-btn { position: relative; background: none; border: 0; color: var(--muted); cursor: pointer; padding: .35rem;
            border-radius: 10px; display: grid; place-items: center; }
.sino-btn:hover, .sino-btn[aria-expanded="true"] { background: var(--bg); color: var(--text); }
.sino-badge { position: absolute; top: 0; right: -2px; min-width: 1.1rem; height: 1.1rem; padding: 0 .3rem; border-radius: 999px;
              background: var(--danger); color: #fff; font-size: .68rem; font-weight: 700; display: grid; place-items: center;
              border: 2px solid var(--card); }
.sino-badge[hidden] { display: none; }
.sino-painel { position: absolute; right: -3.2rem; top: calc(100% + .5rem); width: min(380px, calc(100vw - 1.5rem)); z-index: 40;
               background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
               box-shadow: 0 12px 32px rgba(16,24,40,.18); overflow: hidden; }
.sino-painel header, .sino-painel footer { display: flex; justify-content: space-between; align-items: center; gap: .5rem;
               padding: .65rem .9rem; }
.sino-painel header { border-bottom: 1px solid var(--line); }
.sino-painel footer { border-top: 1px solid var(--line); font-size: .88rem; }
.sino-lista { list-style: none; margin: 0; padding: 0; max-height: min(60vh, 440px); overflow-y: auto; }
.sino-lista li + li { border-top: 1px solid var(--line); }
.sino-lista a { display: flex; gap: .65rem; padding: .65rem .9rem; color: var(--text); }
.sino-lista a:hover { background: var(--bg); }
.sino-lista li.nao-lido a { background: var(--realce); }
.sino-ico { font-size: 1.1rem; line-height: 1.4; }
.sino-txt { display: flex; flex-direction: column; min-width: 0; font-size: .88rem; }
.sino-txt span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sino-txt small { color: var(--muted); font-size: .75rem; margin-top: .15rem; }
.sino-vazio { padding: 1.25rem; text-align: center; color: var(--muted); font-size: .9rem; }
.aviso-toast { position: fixed; right: 1rem; top: 4.25rem; z-index: 60; max-width: min(360px, calc(100vw - 2rem));
               background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--primary);
               border-radius: 10px; box-shadow: 0 12px 32px rgba(16,24,40,.2); opacity: 0; transform: translateY(-8px);
               pointer-events: none; transition: .2s; }
.aviso-toast.visivel { opacity: 1; transform: none; pointer-events: auto; }
.aviso-toast a { display: flex; gap: .6rem; padding: .7rem .9rem; color: var(--text); font-size: .9rem; }
/* página de avisos */
.aviso-item.nao-lido { background: var(--realce); }
.lido-marca { color: var(--ok); font-size: .82rem; font-weight: 600; }
.matriz td, .matriz th { vertical-align: middle; } .matriz td:nth-child(n+2), .matriz th:nth-child(n+2) { text-align: center; width: 4.5rem; }

/* Materiais e mão de obra */
.itens-tabela .num { text-align: right; white-space: nowrap; }
.itens-tabela tfoot td { border-bottom: 0; padding-top: .35rem; padding-bottom: .35rem; }
.itens-tabela tfoot .subtotal td { color: var(--muted); font-size: .88rem; }
.itens-tabela tfoot .total td { font-weight: 700; font-size: 1rem; border-top: 2px solid var(--line); }
.tp-MATERIAL { background: #e0eaff; color: #1f45b0; }
.tp-MAO_DE_OBRA { background: #fff1d6; color: #93550b; }
.tp-SERVICO { background: #dcf5ea; color: #0d6b4c; }
.lancar-item { border-top: 1px dashed var(--line); margin-top: 1rem; padding-top: .25rem; }
.avulso[hidden] { display: none; }
.itens-tabela .col-span { }
.so-mobile { display: none; }
@media (min-width: 640px) { .itens-tabela tfoot .col-span { } }
@media (max-width: 639px) {
  .itens-tabela .col-det { display: none; }
  .itens-tabela .so-mobile { display: block; margin-top: .15rem; }
}

/* Logomarca e temas */
.brand { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.brand-logo { height: 34px; max-width: 140px; object-fit: contain; border-radius: 6px; flex: none;
              background: var(--logo-fundo, transparent); padding: 2px 4px; }
.brand-nome { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .brand-logo + .brand-nome { display: none; } }
.auth .logo-empresa { max-height: 84px; max-width: 220px; object-fit: contain; background: var(--logo-fundo, transparent);
                      padding: 4px 8px; border-radius: 10px; }
.logo-atual { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: .75rem; border: 1px dashed var(--line);
              border-radius: 10px; background: var(--bg); }
.logo-atual img { max-height: 64px; max-width: 200px; object-fit: contain; background: var(--logo-fundo, transparent); padding: 4px 8px; border-radius: 8px; }
.temas { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tema-op { position: relative; display: block; cursor: pointer; border: 2px solid var(--line); border-radius: 12px; overflow: hidden;
           background: var(--card); }
.tema-op input { position: absolute; opacity: 0; pointer-events: none; }
.tema-op:has(input:checked) { border-color: var(--primary); box-shadow: 0 0 0 3px var(--realce); }
.tema-op:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 2px; }
.tema-mini { height: 82px; padding: .55rem; display: flex; flex-direction: column; gap: .35rem; }
.tema-mini .barra { height: 10px; border-radius: 4px; }
.tema-mini .cartao { flex: 1; border-radius: 6px; padding: .35rem; display: flex; flex-direction: column; gap: .25rem; }
.tema-mini .linha-t { height: 6px; border-radius: 3px; width: 70%; }
.tema-mini .botao { width: 40%; height: 12px; border-radius: 4px; margin-top: auto; }
.tema-op .nome { display: block; padding: .45rem .6rem; font-size: .85rem; font-weight: 600; border-top: 1px solid var(--line); }
.cores-pers { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.cor-campo { display: flex; align-items: center; gap: .5rem; border: 1px solid var(--line); border-radius: 10px; padding: .4rem .55rem; background: var(--card); }
.cor-campo input[type=color] { width: 42px; height: 34px; border: 0; padding: 0; background: none; cursor: pointer; flex: none; }
.cor-campo input[type=text] { font-family: ui-monospace, monospace; padding: .35rem .5rem; }
.previa { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

/* ---- Equipamentos / patrimônio ---- */
.eq-vencida, .eq-g-vencida { background: #fde2e2; color: #a2161c; }
.eq-proxima, .eq-g-vencendo { background: #fff1d6; color: #8a4b00; }
.eq-ok { background: #dff5ea; color: #0c6b48; }
.eq-st-MANUTENCAO { background: #ffe7d4; color: #a23e07; }
.eq-st-INATIVO { background: #eceff3; color: #555f6d; }
.stat-alerta b { color: var(--danger); }
.stat-aviso b { color: var(--warn); }
.equip-tags { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: flex-end; }
.filtros-equip { display: grid; gap: .5rem; grid-template-columns: 1fr; margin-bottom: 1rem; }
@media (min-width: 720px) { .filtros-equip { grid-template-columns: 2fr 1.5fr 1fr auto; align-items: end; } }
.filtros-equip .campo { margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .75rem; }
.chip { display: inline-block; padding: .3rem .7rem; border-radius: 999px; border: 1px solid var(--line);
        background: var(--card); color: var(--text); font-size: .85rem; text-decoration: none; }
.chip.ativo { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.chip b { margin-left: .2rem; }
.modulo-oferta { border: 2px dashed var(--primary); }
.modulo-oferta .preco { font-size: 1.6rem; font-weight: 700; }
.lista-beneficios { margin: .5rem 0 1rem; padding-left: 1.2rem; }
.lista-beneficios li { margin: .3rem 0; }
fieldset.grupo { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 0; margin: 0 0 1rem; }
fieldset.grupo legend { font-weight: 600; padding: 0 .35rem; }
.equip-tags-linha .equip-tags { justify-content: flex-start; margin-top: .3rem; }
.equip-tags-linha .equip-tags:empty { display: none; }

/* ---- Fotos dos chamados ---- */
.fotos-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.fotos-escolher { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 52px; padding: .6rem 1rem;
  border: 2px dashed var(--line); border-radius: var(--radius); background: var(--bg); color: var(--primary); font-weight: 600;
  cursor: pointer; }
.fotos-escolher:hover, .fotos-input:focus + .fotos-previa, .fotos-input:focus-visible { border-color: var(--primary); }
.fotos-previa, .fotos-galeria { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-top: .6rem; }
.fotos-previa:empty { display: none; }
.fotos-previa .msg-campo { grid-column: 1 / -1; }
.fotos-previa figure, .fotos-galeria figure { margin: 0; min-width: 0; }
.fotos-previa img, .fotos-galeria img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  object-fit: contain; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); }
.fotos-previa figcaption { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: .2rem; }
.fotos-galeria figcaption { margin-top: .25rem; }
.fotos-enviar { margin-top: .75rem; border-top: 1px solid var(--line); padding-top: .75rem; }
.fotos-dica { margin-top: .3rem; }

/* ---- App instalável: faixa "Instalar / Ativar notificações" ---- */
.pwa-banner { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + env(safe-area-inset-bottom));
  z-index: 60; width: min(640px, calc(100% - 24px)); display: flex; align-items: center; gap: .75rem; flex-wrap: wrap;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 16px; padding: .7rem .9rem;
  box-shadow: 0 10px 30px rgba(16,24,40,.18); }
.pwa-banner img { border-radius: 10px; flex: none; }
.pwa-banner .pwa-texto { flex: 1 1 220px; font-size: .92rem; line-height: 1.35; }
.pwa-banner .pwa-acoes { display: flex; gap: .5rem; align-items: center; margin-left: auto; }
@media (min-width: 820px) { .pwa-banner { bottom: 20px; } }
@media (display-mode: standalone) { .topbar { padding-top: max(.5rem, env(safe-area-inset-top)); } }

.card.assumir { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  border-left: 4px solid var(--primary); }
