/* ═══════════════════════════════════════════════════════════════════════
   Ágil ERP 2.0 — estilo único do sistema ("cara da AM Digital")
   ───────────────────────────────────────────────────────────────────────
   Antes ficava espalhado: um bloco <style> em cada layout e o visual.css
   por cima, sobrescrevendo. Agora é um arquivo só, com o valor final de
   cada regra (nada sobrescreve nada).

   Cada grupo de telas tem a sua seção, presa à classe do <body>:
     body.sistema       telas da empresa (menu lateral, listas, formulários)
     body.painel-master painel master da AMDigital
     body.tela-acesso   login e criar conta
     body.master-login  login do painel master
     body.tela-erro     página de erro 403
   O :where(...) não muda a prioridade das regras — os estilos próprios de
   cada tela (@push('estilos')) continuam valendo como antes.

   Pensado primeiro para o celular. Pontos de quebra iguais aos dos sites
   da AMDigital: 600 / 768 / 992 / 1200 px.
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Fonte Poppins servida daqui mesmo (sem Google Fonts: mais rápido e sem enviar dados a terceiros) ── */
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-500.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-600.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-700.woff2') format('woff2'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'Poppins'; src: url('../fonts/poppins-800.woff2') format('woff2'); font-weight: 800; font-display: swap; }

:root {
    /* Identidade AM Digital (as cores dos posts e do site) */
    --marinho: #111c32;
    --azul: #1c53e1;
    --azul-escuro: #1744bd;
    --azul-anel: #dbe5ff;      /* anel de foco e contorno de destaque */
    --amarelo: #fabe2a;
    --aviso-fundo: #fff8e1;
    --aviso-texto: #8a6200;
    --aviso-borda: #fde9a8;
    --azul-suave: #eef3ff;     /* fundo de item selecionado / em destaque */
    --fundo-2: #f6f7fb;        /* cabeçalho de tabela, caixas internas */
    --fundo-3: #eef1f6;        /* campo desabilitado */
    --linha-suave: #edf0f6;    /* divisória fina dentro de cartões */
    --borda-cartao: #e8ebf2;
    --sombra: 0 1px 2px rgba(17, 28, 50, .05), 0 4px 16px -6px rgba(17, 28, 50, .10);

    /* Nomes usados pelas telas (mantidos para não reescrever cada tela) */
    --ink: var(--marinho);
    --ink-soft: #4a5368;
    --ink-mute: #6c7280;
    --paper: #f4f5f9;
    --card: #ffffff;
    --line: #e3e6ef;
    --amber: var(--azul);          /* nome antigo: era a cor de destaque */
    --amber-deep: var(--azul-escuro);
    --danger: #b3432f;
    --success: #2f6b4f;
    --lateral: 248px;
    --topo: 56px;
}
html { -webkit-text-size-adjust: 100%; }


/* ═══════════════════════════════════════════════════════════════════════
   1. SISTEMA — body.sistema
   ═══════════════════════════════════════════════════════════════════════ */
:where(.sistema) * { box-sizing: border-box; }
body:where(.sistema) { margin: 0; font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif; color: var(--ink); background: var(--paper); }
:where(.sistema) a { color: inherit; }
:where(.sistema) button, :where(.sistema) input, :where(.sistema) select, :where(.sistema) textarea { font-family: inherit; }
:where(.sistema) .icone { flex: none; }

/* ── Menu lateral: gaveta no celular, fixo a partir de 992px ── */
:where(.sistema) .lateral {
    position: fixed; inset: 0 auto 0 0; width: min(84vw, var(--lateral));
    background: var(--marinho); color: #c7cbd6; display: flex; flex-direction: column;
    transform: translateX(-100%); transition: transform .2s ease; z-index: 40; overflow-y: auto;
    /* barra de rolagem fina quando o menu não cabe na altura da tela */
    scrollbar-width: thin; scrollbar-color: #2c3756 transparent;
}
:where(.sistema) .lateral::-webkit-scrollbar { width: 6px; }
:where(.sistema) .lateral::-webkit-scrollbar-thumb { background: #2c3756; border-radius: 3px; }
:where(.sistema) .menu-aberto .lateral { transform: none; }
:where(.sistema) .fundo-menu { position: fixed; inset: 0; background: rgba(16, 25, 46, .45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 30; }
:where(.sistema) .menu-aberto .fundo-menu { opacity: 1; pointer-events: auto; }
:where(.sistema) .lateral-topo { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; }
:where(.sistema) .wordmark { font-size: 19px; font-weight: 700; color: var(--paper); text-decoration: none; }
:where(.sistema) .wordmark span { color: var(--amarelo); }
:where(.sistema) .empresa { padding: 0 18px 14px; font-size: 12px; color: #8b93a7; border-bottom: 1px solid #222c45; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:where(.sistema) .lateral nav { padding: 8px 10px; flex: 1; }
:where(.sistema) .grupo { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #7f8aa6; padding: 14px 10px 6px; }
:where(.sistema) .lateral nav a { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 10px; text-decoration: none; font-size: 14px; color: #c7cbd6; min-height: 42px; }
:where(.sistema) .lateral nav a:hover { background: #1a2742; color: var(--paper); }
:where(.sistema) .lateral nav a.ativo { background: var(--azul); color: #ffffff; box-shadow: 0 6px 16px -8px rgba(28, 83, 225, .9); }
/* Busca "Ir para…" (Ctrl K) e grupos que recolhem */
:where(.sistema) .busca-menu { position: relative; margin: 10px 10px 0; }
:where(.sistema) .busca-menu input { width: 100%; background: #1a2742; border: 1px solid #24324f; color: var(--paper); border-radius: 10px; padding: 8px 64px 8px 32px; font: inherit; font-size: 13px; min-height: 36px; }
:where(.sistema) .busca-menu input::placeholder { color: #8b93a7; }
:where(.sistema) .busca-menu input:focus { outline: none; border-color: var(--amarelo); }
:where(.sistema) .busca-menu svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: #8b93a7; pointer-events: none; }
:where(.sistema) .busca-menu kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 600 10px/1 inherit; color: #8b93a7; border: 1px solid #3a4459; border-radius: 4px; padding: 3px 5px; pointer-events: none; }
:where(.sistema) .lateral nav [hidden] { display: none !important; }
:where(.sistema) .busca-menu input::-webkit-search-cancel-button { -webkit-appearance: none; }
:where(.sistema) .busca-menu input:not(:placeholder-shown) ~ kbd { display: none; }
@media (max-width: 991px) {
    :where(.sistema) .busca-menu kbd { display: none; }
    :where(.sistema) .busca-menu input { padding-right: 10px; }
}
:where(.sistema) .menu-vazio { color: #8b93a7; font-size: 13px; padding: 12px 10px; }
:where(.sistema) button.grupo { display: flex; align-items: center; justify-content: space-between; width: 100%; background: none; border: none; font: inherit; font-size: 11px; cursor: pointer; text-align: left; }
:where(.sistema) button.grupo:hover { color: #c7cbd6; }
:where(.sistema) button.grupo svg { transition: transform .15s; }
:where(.sistema) .secao.recolhida button.grupo svg { transform: rotate(-90deg); }
:where(.sistema) .secao.recolhida .secao-itens { display: none; }
:where(.sistema) .selo-menu { margin-left: auto; background: #f59e0b; color: #1f2937; border-radius: 999px; font-size: 11px; font-weight: 700; padding: 1px 7px; line-height: 16px; }
:where(.sistema) .lateral-rodape { border-top: 1px solid #222c45; padding: 12px 18px 18px; font-size: 13px; }
:where(.sistema) .lateral-rodape .quem { color: var(--paper); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
:where(.sistema) .lateral-rodape .email { color: #8b93a7; font-size: 12px; }
:where(.sistema) .lateral-rodape button { margin-top: 10px; display: inline-flex; align-items: center; gap: 8px; background: transparent; border: 1px solid #3a4459; color: var(--paper); padding: 8px 12px; border-radius: 8px; font: inherit; cursor: pointer; }
:where(.sistema) .lateral-rodape button:hover { border-color: var(--amarelo); color: var(--amarelo); }
:where(.sistema) .lateral-rodape .manual { display: inline-flex; align-items: center; gap: 6px; color: #8b93a7; font-size: 12px; text-decoration: none; margin-top: 8px; }
:where(.sistema) .lateral-rodape .manual:hover { color: var(--azul); }
:where(.sistema) .botao-icone { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: none; background: transparent; color: inherit; cursor: pointer; }
:where(.sistema) .botao-icone:hover { background: rgba(127, 127, 127, .12); }

/* ── Área principal ── */
:where(.sistema) .topo { position: sticky; top: 0; z-index: 20; height: var(--topo); display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--card); border-bottom: 1px solid var(--line); }
:where(.sistema) .topo h2 { font-size: 16px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* "+ Criar" no topo */
:where(.sistema) .criar { position: relative; }
:where(.sistema) .criar summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; background: var(--azul); color: var(--paper); border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 14px; cursor: pointer; min-height: 38px; }
:where(.sistema) .criar summary::-webkit-details-marker { display: none; }
:where(.sistema) .criar-menu { position: absolute; right: 0; top: calc(100% + 6px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 25, 46, .16); min-width: 240px; padding: 6px; z-index: 50; }
:where(.sistema) .criar-menu a { display: block; padding: 9px 12px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 14px; }
:where(.sistema) .criar-menu a:hover, :where(.sistema) .criar-menu a:focus { background: #f1f3f7; outline: none; }
@media (max-width: 600px) { :where(.sistema) .criar .criar-txt { display: none; } }
:where(.sistema) .aviso-plano { background: var(--aviso-fundo); color: var(--aviso-texto); border-bottom: 1px solid var(--aviso-borda); font-size: 13px; padding: 8px 16px; }
/* Faixa da demonstração (/demo): marinho com o convite em amarelo */
:where(.sistema) .faixa-demo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; background: var(--marinho); color: #dfe3ec; font-size: 13px; padding: 10px 16px; }
:where(.sistema) .faixa-demo strong { color: #fff; }
:where(.sistema) .faixa-demo .btn { background: var(--amarelo); color: var(--marinho); box-shadow: none; }
:where(.sistema) .faixa-demo .btn:hover { background: #ffd35c; }
@media (min-width: 992px) { :where(.sistema) .faixa-demo { padding: 10px 24px; } }
:where(.sistema) main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 16px; }

@media (min-width: 992px) {
    :where(.sistema) .lateral { transform: none; width: var(--lateral); }
    /* No computador o menu é mais compacto (no celular os itens ficam
       maiores, para o dedo) — assim cabe inteiro em telas de notebook */
    :where(.sistema) .lateral nav a { min-height: 36px; padding: 7px 10px; }
    :where(.sistema) .grupo { padding: 10px 10px 4px; }
    :where(.sistema) .lateral-topo { padding-top: 14px; }
    :where(.sistema) .fundo-menu, :where(.sistema) .so-celular { display: none !important; }
    :where(.sistema) .principal { margin-left: var(--lateral); }
    :where(.sistema) .topo { padding: 0 24px; }
    :where(.sistema) main { padding: 28px 32px; }
}

/* ── Menu recolhido no computador (só ícones), como na 1.5 ── */
:where(.sistema) .so-computador { display: none !important; }
@media (min-width: 992px) {
    :where(.sistema) .so-computador { display: inline-flex !important; }
    :where(.sistema) .lateral, :where(.sistema) .principal { transition: width .18s ease, margin-left .18s ease; }
    html.menu-mini { --lateral: 68px; }
    html.menu-mini :where(.sistema) main { max-width: 1480px; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral .rotulo,
    html.menu-mini:not(.menu-espiar) :where(.sistema) .wordmark span,
    html.menu-mini:not(.menu-espiar) :where(.sistema) .empresa,
    html.menu-mini:not(.menu-espiar) :where(.sistema) .busca-menu,
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral-rodape .quem,
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral-rodape .email,
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral .grupo { display: none; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral-topo { justify-content: center; padding: 16px 0 10px; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral nav { padding: 4px 10px; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .secao { border-top: 1px solid #222c45; padding-top: 6px; margin-top: 6px; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .secao:first-child { border-top: none; margin-top: 0; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .secao.recolhida .secao-itens { display: block; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral nav a { justify-content: center; padding: 8px 0; position: relative; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral nav a .selo-menu { position: absolute; top: 2px; right: 2px; padding: 0 5px; font-size: 10px; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral-rodape { padding: 12px 0 16px; text-align: center; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral-rodape button { padding: 8px; }
    html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral-rodape .manual { justify-content: center; }
    /* Ctrl+K com o menu recolhido: abre por cima da tela enquanto busca */
    html.menu-mini.menu-espiar :where(.sistema) .lateral { width: 248px; box-shadow: 0 10px 40px rgba(16, 25, 46, .35); }
}

/* ── Avisos ── */
:where(.sistema) .flash { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; }
:where(.sistema) .flash.success { background: #eaf3ee; border: 1px solid #bfdccb; color: var(--success); }
:where(.sistema) .flash.warning { background: var(--aviso-fundo); border: 1px solid var(--aviso-borda); color: var(--aviso-texto); }
:where(.sistema) .flash.erro { background: #fbecea; border: 1px solid #ecc1b8; color: var(--danger); }
:where(.sistema) .flash ul { margin: 0; padding-left: 18px; }

/* ── Cabeçalho da página: quebra linha no celular ── */
:where(.sistema) .page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 20px; }
:where(.sistema) .page-head h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 0 0 4px; }
:where(.sistema) .page-head .sub { font-size: 13px; color: var(--ink-soft); margin: 0; }
:where(.sistema) .form-card .sub { font-size: 13px; color: var(--ink-soft); }

/* ── Botões em pílula azul ── */
:where(.sistema) .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: var(--azul); color: var(--paper); padding: 10px 20px; min-height: 42px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; border: none; cursor: pointer; font-family: inherit; }
:where(.sistema) .btn:hover { background: var(--azul-escuro); }
:where(.sistema) .btn.secundario { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
:where(.sistema) .btn.secundario:hover { border-color: var(--azul); color: var(--azul); }
:where(.sistema) .btn.danger { background: var(--danger); }
:where(.sistema) .btn.btn-pequeno { min-height: 34px; padding: 6px 12px; font-size: 13px; }
:where(.sistema) .btn.whatsapp { background: #1f9d55; color: #fff; }
:where(.sistema) .btn.whatsapp:hover { background: #17834a; }
:where(.sistema) td.acoes .btn { padding: 7px 12px; font-size: 13px; }

/* ── Filtros: quebram em várias linhas, sem largura mínima fixa ── */
:where(.sistema) .filtros { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
:where(.sistema) .filtros > * { flex: 1 1 180px; }
:where(.sistema) .campo-busca { position: relative; }
:where(.sistema) .campo-busca .icone { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--ink-mute); }
:where(.sistema) .campo-busca input { padding-left: 38px !important; }

/* ── Tabelas e cartões claros ── */
:where(.sistema) table { width: 100%; border-collapse: collapse; background: var(--card); border: 1px solid var(--borda-cartao); border-radius: 16px; box-shadow: var(--sombra); overflow: hidden; }
:where(.sistema) th, :where(.sistema) td { text-align: left; padding: 12px 16px; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
:where(.sistema) th { font-weight: 600; color: var(--ink-soft); font-size: 12px; background: var(--fundo-2); }
:where(.sistema) tr:last-child td { border-bottom: none; }
:where(.sistema) tbody tr:hover td, :where(.sistema) tr[data-href]:hover td { background: #f5f8ff; }
:where(.sistema) td.acoes { text-align: right; white-space: nowrap; }
/* Valores em R$ nas listas não quebram linha ("R$" numa linha e o número na outra) */
:where(.sistema) td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Tabelas no celular: cada linha vira um cartão (rótulos vêm do <th>,
   preenchidos pelo script no fim da página) */
@media (max-width: 767px) {
    :where(.sistema) main table:not(.nao-responsiva), :where(.sistema) main table:not(.nao-responsiva) tbody, :where(.sistema) main table:not(.nao-responsiva) tr, :where(.sistema) main table:not(.nao-responsiva) td { display: block; width: 100%; }
    :where(.sistema) main table:not(.nao-responsiva) { background: transparent; border: none; }
    :where(.sistema) main table:not(.nao-responsiva) thead { display: none; }
    :where(.sistema) main table:not(.nao-responsiva) tr { background: var(--card); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; padding: 6px 0; }
    :where(.sistema) main table:not(.nao-responsiva) td { border: none; padding: 6px 14px; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
    :where(.sistema) main table:not(.nao-responsiva) td::before { content: attr(data-label); color: var(--ink-mute); font-size: 12px; text-align: left; flex: none; max-width: 45%; }
    :where(.sistema) main table:not(.nao-responsiva) td[data-label=""]::before { content: none; }
    /* 1ª coluna vira o título do cartão: sem rótulo, alinhada à esquerda */
    :where(.sistema) main table:not(.nao-responsiva) td:first-child { font-weight: 600; font-size: 15px; justify-content: flex-start; text-align: left; padding-top: 8px; padding-bottom: 8px; }
    :where(.sistema) main table:not(.nao-responsiva) td:first-child::before { content: none; }
    :where(.sistema) main table:not(.nao-responsiva) td.acoes { justify-content: flex-end; }
}

:where(.sistema) .vazio { padding: 40px 20px; text-align: center; color: var(--ink-soft); font-size: 14px; background: var(--card); border: 1px dashed var(--line); border-radius: 16px; }

/* ── Formulários ── */
:where(.sistema) .field { margin-bottom: 16px; }
:where(.sistema) .field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
:where(.sistema) .field input, :where(.sistema) .field select, :where(.sistema) .field textarea, :where(.sistema) .filtros input, :where(.sistema) .filtros select {
    width: 100%; padding: 10px 12px; min-height: 42px; border: 1px solid var(--line); border-radius: 12px;
    font-size: 16px; /* 16px evita o zoom automático do iPhone ao tocar no campo */
    background: var(--card); color: var(--ink); font-family: inherit;
}
@media (min-width: 768px) { :where(.sistema) .field input, :where(.sistema) .field select, :where(.sistema) .field textarea, :where(.sistema) .filtros input, :where(.sistema) .filtros select { font-size: 14px; } }
:where(.sistema) .field input:focus, :where(.sistema) .field select:focus, :where(.sistema) .field textarea:focus, :where(.sistema) .filtros input:focus, :where(.sistema) .filtros select:focus, :where(.sistema) .tabela-itens input:focus { outline: 3px solid var(--azul-anel); outline-offset: 0; border-color: var(--azul); }
:where(.sistema) .field .erro { color: var(--danger); font-size: 12px; margin-top: 4px; }
:where(.sistema) .field input:disabled, :where(.sistema) .field select:disabled, :where(.sistema) .field textarea:disabled { background: var(--fundo-3); color: var(--ink-soft); cursor: not-allowed; }
:where(.sistema) .grid-2 { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 600px) { :where(.sistema) .grid-2 { grid-template-columns: 1fr 1fr; } }
:where(.sistema) .grid-datas { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 600px) { :where(.sistema) .grid-datas { grid-template-columns: repeat(3, 1fr); } }
:where(.sistema) .form-card { background: var(--card); border: 1px solid var(--borda-cartao); border-radius: 16px; box-shadow: var(--sombra); padding: 18px; max-width: 720px; }
@media (min-width: 768px) { :where(.sistema) .form-card { padding: 24px; } }
:where(.sistema) .form-card table { box-shadow: none; }
:where(.sistema) .link-tenue { color: var(--ink-soft); font-size: 13px; text-decoration: none; }
:where(.sistema) .link-tenue:hover { color: var(--ink); }
:where(.sistema) .tag { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #eef0f4; color: var(--ink-soft); }
:where(.sistema) .tag-ok { background: #eaf3ee; color: var(--success); }
:where(.sistema) .tag-alerta { background: var(--aviso-fundo); color: var(--aviso-texto); border-color: var(--aviso-borda); }
:where(.sistema) .tag-ruim { background: #fbecea; color: var(--danger); }
:where(.sistema) .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:where(.sistema) .resumo-lista { font-size: 13px; color: var(--ink-soft); margin: -4px 0 12px; }
:where(.sistema) .botao-link { background: none; border: none; padding: 0; font: inherit; font-size: 13px; cursor: pointer; }
:where(.sistema) .form-inline-pagamento { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
:where(.sistema) .form-inline-pagamento label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; font-weight: 600; flex: 1 1 140px; text-align: left; }
:where(.sistema) .form-inline-pagamento input { padding: 8px 10px; min-height: 40px; border: 1px solid var(--line); border-radius: 8px; font: inherit; font-size: 15px; }

/* ── Formulários de orçamento, OS e venda ── */
:where(.sistema) .form-card.form-largo { max-width: 1040px; }
:where(.sistema) .titulo-bloco { font-size: 15px; margin: 24px 0 12px; }
:where(.sistema) .escolhido { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; background: var(--fundo-2); }
:where(.sistema) .escolhido strong { display: block; font-size: 14px; }
:where(.sistema) .busca-suspensa { position: relative; }
:where(.sistema) .sugestoes { position: absolute; z-index: 25; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 28px -12px rgba(16, 25, 46, .3); max-height: 320px; overflow-y: auto; }
:where(.sistema) .sugestoes button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; text-align: left; background: none; border: none; padding: 9px 10px; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
:where(.sistema) .sugestoes button:hover, :where(.sistema) .sugestoes button:focus { background: var(--azul-suave); outline: none; }
:where(.sistema) .sugestoes .sem-resultado { padding: 10px; font-size: 13px; color: var(--ink-soft); }
:where(.sistema) .bloco-itens { margin: 8px 0 4px; }
:where(.sistema) .bloco-itens-topo { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
:where(.sistema) .bloco-itens-topo h3 { font-size: 15px; margin: 0; flex: 0 0 auto; }
:where(.sistema) .bloco-itens-topo .adicionar-item { flex: 1 1 260px; }
:where(.sistema) .bloco-itens-topo .campo-busca input { width: 100%; padding: 10px 12px; min-height: 42px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 15px; }
:where(.sistema) .tabela-itens input { width: 100%; padding: 8px 10px; min-height: 38px; border: 1px solid var(--line); border-radius: 12px; font: inherit; font-size: 15px; background: var(--card); color: var(--ink); }
:where(.sistema) .tabela-itens input:disabled { background: var(--fundo-3); color: var(--ink-soft); }
:where(.sistema) .tabela-itens td { padding: 8px 10px; vertical-align: top; }
:where(.sistema) .total-itens { display: flex; justify-content: flex-end; gap: 16px; align-items: baseline; padding: 12px 4px 0; font-size: 14px; }
:where(.sistema) .total-itens strong { font-size: 19px; }
:where(.sistema) .acoes-form { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
:where(.sistema) .resumo-venda { background: var(--fundo-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
:where(.sistema) .resumo-venda div { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
:where(.sistema) .resumo-venda .total { font-size: 18px; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
@media (max-width: 767px) {
    :where(.sistema) main table.tabela-itens tr { display: grid !important; grid-template-columns: 1fr 1fr; gap: 2px 10px; padding: 8px 4px; position: relative; }
    :where(.sistema) main table.tabela-itens td { display: block !important; text-align: left !important; padding: 4px 10px !important; }
    :where(.sistema) main table.tabela-itens td:first-child { grid-column: 1 / -1; padding-right: 48px !important; }
    :where(.sistema) main table.tabela-itens td:last-child[data-label=""] { position: absolute; top: 6px; right: 0; width: auto !important; padding: 4px !important; }
    :where(.sistema) main table.tabela-itens td::before { display: block; margin-bottom: 4px; }
    :where(.sistema) main table.tabela-itens td:first-child { padding-top: 6px; }
}
:where(.sistema) tr.linha-form td { background: var(--fundo-2); font-weight: 400 !important; font-size: 14px !important; }
@media (max-width: 767px) { :where(.sistema) main table:not(.nao-responsiva) tr.linha-form td { display: block; text-align: left; } }

/* ── Ramos: blocos extras nos formulários (oficina, garantia) ── */
:where(.sistema) .caixa-ramo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; margin: 8px 0 14px; background: var(--fundo-2); border: 1px solid var(--line); border-radius: 12px; }
:where(.sistema) .caixa-ramo strong { font-size: 14px; }
:where(.sistema) .dica-campo { font-size: 12px; color: var(--ink-mute, var(--ink-soft)); margin-top: 4px; }
:where(.sistema) .dica-campo.dica-alerta { color: var(--aviso-texto); font-weight: 600; }
:where(.sistema) .sugestao-garantia { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 10px 14px; margin: -4px 0 14px; background: var(--aviso-fundo); border: 1px solid var(--aviso-borda); border-radius: 12px; font-size: 14px; color: var(--aviso-texto); }
:where(.sistema) .campo-composto { display: flex; flex-wrap: nowrap; gap: 8px; align-items: center; }
:where(.sistema) .campo-composto input { flex: 1 1 70px; min-width: 0; }
:where(.sistema) .placa { display: inline-block; border: 2px solid var(--ink); border-radius: 6px; padding: 1px 8px; font-weight: 800; font-size: 13px; letter-spacing: .06em; background: #fff; color: var(--ink); white-space: nowrap; }
:where(.sistema) .placa.grande { border-width: 3px; border-radius: 8px; padding: 4px 14px; font-size: 24px; }
:where(.sistema) .ficha { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
@media (min-width: 900px) { :where(.sistema) .ficha { grid-template-columns: 320px 1fr; } }
:where(.sistema) .ficha-dados { display: grid; gap: 10px; font-size: 14px; margin-top: 14px; }
:where(.sistema) .ficha-dados span { display: block; font-size: 12px; color: var(--ink-soft); }
:where(.sistema) .texto-ruim { color: var(--danger); }
:where(.sistema) .linha-revisao { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 0; border-top: 1px solid var(--line); }
:where(.sistema) .linha-revisao .quem { flex: 1 1 160px; min-width: 0; }
:where(.sistema) .linha-revisao .quem span { display: block; }
:where(.sistema) .linha-revisao .quando { display: flex; align-items: center; gap: 10px; margin-left: auto; }
:where(.sistema) .aviso-bloqueio { max-width: 460px; margin: 40px auto; text-align: center; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 32px 24px; }
:where(.sistema) .aviso-bloqueio h1 { font-size: 19px; margin: 8px 0; }
:where(.sistema) .aviso-bloqueio p { color: var(--ink-soft); font-size: 14px; margin: 0 0 18px; }
:where(.sistema) .aviso-icone { font-size: 34px; }


/* ═══════════════════════════════════════════════════════════════════════
   2. PAINEL MASTER — body.painel-master
   ═══════════════════════════════════════════════════════════════════════ */
body:where(.painel-master) { --ink-2: #18233c; --muted: #6b7385; --danger-soft: #fbecea; --success-soft: #eaf3ee; --blue: var(--azul); --blue-soft: var(--azul-suave); }
:where(.painel-master) * { box-sizing: border-box; }
body:where(.painel-master) { margin: 0; font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif; color: var(--ink); background: var(--paper); }
:where(.painel-master) a { color: inherit; }
:where(.painel-master) button, :where(.painel-master) input, :where(.painel-master) select, :where(.painel-master) textarea { font-family: inherit; }

/* ── estrutura: menu lateral + conteúdo ── */
:where(.painel-master) .app { display: flex; min-height: 100vh; }
:where(.painel-master) .lateral { width: 248px; flex-shrink: 0; background: var(--marinho); color: #dfe3ec; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
:where(.painel-master) .marca { padding: 24px 22px 20px; border-bottom: 1px solid #263252; }
:where(.painel-master) .marca .tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--amarelo); border-radius: 4px; padding: 2px 7px; }
:where(.painel-master) .marca .nome { font-size: 20px; font-weight: 700; margin-top: 8px; color: #fff; }
:where(.painel-master) .marca .nome span { color: var(--amarelo); }
:where(.painel-master) .marca .ola { font-size: 12px; color: #9aa3b8; margin-top: 2px; }
:where(.painel-master) .menu { padding: 12px 12px 24px; flex: 1; }
:where(.painel-master) .menu .grupo { font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: #7d869c; margin: 18px 10px 6px; font-weight: 600; }
:where(.painel-master) .menu a, :where(.painel-master) .menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 8px; color: #dfe3ec; text-decoration: none; font-size: 14px; background: none; border: none; cursor: pointer; font-family: inherit; text-align: left; }
:where(.painel-master) .menu a { border-radius: 10px; }
:where(.painel-master) .menu button:hover { background: var(--ink-2); color: #fff; }
:where(.painel-master) .menu a:hover { background: #1a2742; color: #fff; }
:where(.painel-master) .menu a.ativo { background: var(--azul); color: #fff; font-weight: 600; box-shadow: 0 6px 16px -8px rgba(28, 83, 225, .9); }
:where(.painel-master) .menu .ic { width: 18px; text-align: center; opacity: .9; }
:where(.painel-master) .menu .cont { margin-left: auto; background: var(--amarelo); color: var(--ink); font-size: 11px; font-weight: 700; border-radius: 10px; padding: 1px 7px; }
:where(.painel-master) .menu .sair { color: #f0a597; }

:where(.painel-master) .conteudo { flex: 1; min-width: 0; }
:where(.painel-master) .topo { background: #fff; border-bottom: 1px solid var(--line); padding: 18px 32px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; position: sticky; top: 0; z-index: 5; }
:where(.painel-master) .topo h1 { font-size: 20px; margin: 0; }
:where(.painel-master) .topo .sub { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
:where(.painel-master) main { padding: 28px 32px 48px; max-width: 1480px; }

@media (max-width: 860px) {
    :where(.painel-master) .app { flex-direction: column; }
    :where(.painel-master) .lateral { width: 100%; height: auto; position: static; }
    :where(.painel-master) .menu { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 12px 12px; }
    :where(.painel-master) .menu .grupo { display: none; }
    :where(.painel-master) .menu a, :where(.painel-master) .menu button, :where(.painel-master) .menu form { width: auto; }
    :where(.painel-master) .topo, :where(.painel-master) main { padding-left: 16px; padding-right: 16px; }
}

/* ── componentes ── */
:where(.painel-master) .flash { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 20px; }
:where(.painel-master) .flash.success { background: var(--success-soft); border: 1px solid #bfdccb; color: var(--success); }
:where(.painel-master) .flash.erro { background: var(--danger-soft); border: 1px solid #ecc1b8; color: var(--danger); }
:where(.painel-master) .flash.warning { background: var(--aviso-fundo); color: var(--aviso-texto); border-color: var(--aviso-borda); }

:where(.painel-master) .btn { display: inline-flex; align-items: center; gap: 6px; background: var(--azul); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; font-family: inherit; white-space: nowrap; }
:where(.painel-master) .btn:hover { background: var(--azul-escuro); }
:where(.painel-master) .btn.azul { background: var(--blue); }
:where(.painel-master) .btn.azul:hover { background: var(--azul-escuro); }
:where(.painel-master) .btn.claro { background: #fff; color: var(--ink); border-color: var(--line); }
:where(.painel-master) .btn.claro:hover { border-color: var(--ink-soft); background: #fff; }
:where(.painel-master) .btn.danger { background: var(--danger); }
:where(.painel-master) .btn.danger:hover { background: #8f3626; }
:where(.painel-master) .btn.grande { padding: 12px 20px; font-size: 15px; }
:where(.painel-master) .btn.bloco { width: 100%; justify-content: center; }
:where(.painel-master) td.acoes .btn { padding: 7px 12px; font-size: 13px; }

:where(.painel-master) .card { background: #fff; border: 1px solid var(--line); border-radius: 12px; }
:where(.painel-master) .card-cab { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
:where(.painel-master) .card-cab h2 { font-size: 15px; margin: 0; }
:where(.painel-master) .card-corpo { padding: 20px; }

:where(.painel-master) .numeros { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 24px; }
:where(.painel-master) .numero { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: flex; gap: 14px; align-items: center; text-decoration: none; }
:where(.painel-master) .numero .ic { width: 46px; height: 46px; border-radius: 10px; display: grid; place-items: center; font-size: 20px; flex-shrink: 0; }
:where(.painel-master) .numero .v { font-size: 24px; font-weight: 700; line-height: 1.1; }
:where(.painel-master) .numero .r { font-size: 12.5px; color: var(--muted); }
:where(.painel-master) .numero .x { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

:where(.painel-master) table { width: 100%; border-collapse: collapse; background: #fff; border-color: var(--borda-cartao); border-radius: 16px; box-shadow: var(--sombra); }
:where(.painel-master) th, :where(.painel-master) td { text-align: left; padding: 13px 16px; font-size: 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
:where(.painel-master) th { font-weight: 600; color: var(--ink-soft); font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; background: var(--fundo-2); }
:where(.painel-master) tr:last-child td { border-bottom: none; }
:where(.painel-master) tbody tr:hover td { background: #f5f8ff; }
:where(.painel-master) .tabela { border: 1px solid var(--borda-cartao); border-radius: 16px; box-shadow: var(--sombra); overflow-x: auto; background: #fff; }
:where(.painel-master) .tabela table { box-shadow: none; border: none; border-radius: 0; }
:where(.painel-master) .tabela th, :where(.painel-master) .tabela td { padding: 12px; }
:where(.painel-master) td .min { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
:where(.painel-master) .tabela td .min { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Tabela de empresas sem barra de rolagem em notebook: o botão Renovar vira só o ícone */
@media (max-width: 1700px) { :where(.painel-master) .rotulo-renovar { display: none; } }
:where(.painel-master) td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
:where(.painel-master) td.acoes { white-space: nowrap; text-align: right; }
:where(.painel-master) td.acoes > * { margin-left: 6px; }

:where(.painel-master) .vazio { padding: 36px; text-align: center; color: var(--muted); font-size: 14px; border-radius: 16px; }

:where(.painel-master) .tag { border-radius: 999px; }
:where(.painel-master) .badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
:where(.painel-master) .badge.ativo { background: var(--success-soft); color: var(--success); }
:where(.painel-master) .badge.trial, :where(.painel-master) .badge.pendente { background: var(--aviso-fundo); color: var(--aviso-texto); }
:where(.painel-master) .badge.bloqueado, :where(.painel-master) .badge.vencido { background: var(--danger-soft); color: var(--danger); }
:where(.painel-master) .badge.neutro { background: #eef0f4; color: var(--ink-soft); }
:where(.painel-master) .badge.casa { background: var(--aviso-fundo); color: var(--aviso-texto); }
:where(.painel-master) .badge.demo { background: #e8eefc; color: #1d4ed8; }

:where(.painel-master) .dias { font-size: 12px; display: block; margin-top: 2px; white-space: nowrap; }
:where(.painel-master) .dias.ok { color: var(--success); }
:where(.painel-master) .dias.alerta { color: var(--aviso-texto); }
:where(.painel-master) .dias.vencido { color: var(--danger); }

:where(.painel-master) .grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
@media (max-width: 640px) { :where(.painel-master) .grade { grid-template-columns: 1fr; } }
:where(.painel-master) .campo { margin-bottom: 18px; }
:where(.painel-master) .campo label, :where(.painel-master) .rotulo { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
:where(.painel-master) .campo input, :where(.painel-master) .campo select, :where(.painel-master) .campo textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff; color: var(--ink); }
:where(.painel-master) .campo input:focus, :where(.painel-master) .campo select:focus, :where(.painel-master) .campo textarea:focus { outline: 2px solid var(--amber); outline-offset: -1px; border-color: transparent; }
:where(.painel-master) .campo input[type=checkbox], :where(.painel-master) .campo input[type=radio] { width: auto; padding: 0; margin: 0; accent-color: var(--blue); }
:where(.painel-master) .campo label.chip { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-weight: 500; }
:where(.painel-master) .campo input[readonly] { background: var(--fundo-2); color: var(--ink-soft); }
:where(.painel-master) .campo .ajuda { font-size: 12px; color: var(--muted); margin-top: 4px; }
:where(.painel-master) .campo .erro { font-size: 12px; color: var(--danger); margin-top: 4px; }

:where(.painel-master) .planos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
:where(.painel-master) .plano { position: relative; display: block; border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; background: #fff; }
:where(.painel-master) .plano input { position: absolute; opacity: 0; pointer-events: none; }
:where(.painel-master) .plano:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
:where(.painel-master) .plano .n { font-weight: 700; font-size: 15px; }
:where(.painel-master) .plano .p { color: var(--blue); font-size: 22px; font-weight: 700; margin: 6px 0 4px; }
:where(.painel-master) .plano .p small { font-size: 12px; color: var(--muted); font-weight: 500; }
:where(.painel-master) .plano .d { font-size: 12px; color: var(--muted); line-height: 1.5; }

:where(.painel-master) .chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
:where(.painel-master) .chip { padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 8px; background: #fff; font-size: 13.5px; cursor: pointer; font-family: inherit; color: var(--ink); }
:where(.painel-master) .chip:hover { border-color: var(--ink-soft); }
:where(.painel-master) .chip.ativo { border-color: var(--blue); color: var(--blue); background: var(--blue-soft); font-weight: 600; }

:where(.painel-master) .info { display: grid; grid-template-columns: 170px 1fr; gap: 8px 12px; font-size: 14px; }
:where(.painel-master) .info dt { color: var(--muted); }
:where(.painel-master) .info dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
:where(.painel-master) code { overflow-wrap: anywhere; font-size: 12.5px; background: var(--fundo-2); padding: 1px 6px; border-radius: 4px; }

:where(.painel-master) .link-tenue { color: var(--ink-soft); font-size: 13px; text-decoration: none; }
:where(.painel-master) .link-tenue:hover { color: var(--ink); text-decoration: underline; }
:where(.painel-master) .mt { margin-top: 20px; }
:where(.painel-master) .pilha > * + * { margin-top: 20px; }


/* ═══════════════════════════════════════════════════════════════════════
   3. LOGIN E CRIAR CONTA — body.tela-acesso (+ .tela-cadastro)
   ═══════════════════════════════════════════════════════════════════════ */
:where(.tela-acesso) * { box-sizing: border-box; }
body:where(.tela-acesso) { margin: 0; font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif; color: var(--ink); background: var(--paper); }
:where(.tela-acesso) button, :where(.tela-acesso) input, :where(.tela-acesso) select, :where(.tela-acesso) textarea { font-family: inherit; }
:where(.tela-acesso) .shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 860px) {
    :where(.tela-acesso) .shell { grid-template-columns: 1fr; }
    :where(.tela-acesso) .brand { min-height: 220px; }
}
:where(.tela-acesso) .brand { background: var(--marinho); color: var(--paper); padding: 56px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
:where(.tela-acesso) .brand::after { content: ""; position: absolute; right: -120px; bottom: -120px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle at 30% 30%, rgba(28, 83, 225, .45), transparent 70%); }
:where(.tela-acesso) .wordmark { font-size: 28px; font-weight: 700; letter-spacing: -0.01em; }
:where(.tela-acesso) .wordmark span { color: var(--amarelo); }
:where(.tela-acesso) .brand-copy { max-width: 360px; position: relative; }
:where(.tela-acesso) .brand-copy h1 { font-size: 34px; line-height: 1.2; font-weight: 700; margin: 0 0 14px; letter-spacing: -0.01em; }
:where(.tela-acesso) .brand-copy p { font-size: 15px; line-height: 1.6; color: #c7cbd6; margin: 0; }
:where(.tela-acesso) .brand-foot { font-size: 13px; color: #7d879c; position: relative; }
:where(.tela-acesso) .panel { display: flex; align-items: center; justify-content: center; padding: 40px 32px; }
:where(.tela-acesso) .card { width: 100%; max-width: 360px; }
:where(.tela-acesso) .card h2 { font-size: 22px; font-weight: 700; margin: 0 0 6px; }
:where(.tela-acesso) .card .lead { font-size: 14px; color: var(--ink-soft); margin: 0 0 28px; }
:where(.tela-acesso) .field { margin-bottom: 18px; }
:where(.tela-acesso) .field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--ink); }
:where(.tela-acesso) .field input, :where(.tela-acesso) .field select { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; background: #fff; color: var(--ink); }
:where(.tela-acesso) .field input:focus, :where(.tela-acesso) .field select:focus { outline: 3px solid var(--azul-anel); outline-offset: 0; border-color: var(--azul); }
:where(.tela-acesso) .field .dica { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
/* Campo-isca contra robôs: fora da tela para quem usa o navegador normalmente */
:where(.tela-acesso) .isca { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
:where(.tela-acesso) .submit { width: 100%; padding: 12px 14px; border: none; border-radius: 999px; background: var(--azul); color: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 6px; }
:where(.tela-acesso) .submit:hover { background: var(--azul-escuro); }
:where(.tela-acesso) .submit:focus-visible { outline: 2px solid var(--azul); outline-offset: 2px; }
:where(.tela-acesso) .errors { background: #fbecea; border: 1px solid #ecc1b8; color: var(--danger); font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 20px; }
:where(.tela-acesso) .errors ul { margin: 0; padding-left: 18px; }
:where(.tela-acesso) .success { background: #eaf3ee; border: 1px solid #bfdccb; color: var(--success); font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 20px; }
:where(.tela-acesso) .rodape-link { text-align: center; margin-top: 18px; font-size: 13px; color: var(--ink-soft); }
:where(.tela-acesso) .rodape-link a { color: var(--ink); font-weight: 600; }
:where(.tela-acesso) .docs-links { margin-top: 8px; font-size: 12px; }
:where(.tela-acesso) .docs-links a { font-weight: 500; color: var(--ink-soft); }
/* Criar conta: cartão um pouco mais largo e campos mais próximos */
:where(.tela-cadastro) .card { max-width: 380px; }
:where(.tela-cadastro) .card .lead { margin-bottom: 24px; }
:where(.tela-cadastro) .field { margin-bottom: 16px; }


/* ═══════════════════════════════════════════════════════════════════════
   4. LOGIN DO PAINEL MASTER — body.master-login
   ═══════════════════════════════════════════════════════════════════════ */
:where(.master-login) * { box-sizing: border-box; }
body:where(.master-login) { margin: 0; min-height: 100vh; display: flex; align-items: center; justify-content: center; font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif; color: var(--ink); background: var(--marinho); }
:where(.master-login) button, :where(.master-login) input, :where(.master-login) select, :where(.master-login) textarea { font-family: inherit; }
:where(.master-login) .card { width: 100%; max-width: 360px; background: #fff; border-radius: 10px; padding: 36px 32px; }
:where(.master-login) .wordmark { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
:where(.master-login) .wordmark span { color: var(--amarelo); }
:where(.master-login) .tag { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin: 0 0 24px; }
:where(.master-login) .field { margin-bottom: 18px; }
:where(.master-login) .field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
:where(.master-login) .field input { width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 12px; font-size: 14px; background: #fff; color: var(--ink); }
:where(.master-login) .field input:focus { outline: 3px solid var(--azul-anel); outline-offset: 0; border-color: var(--azul); }
:where(.master-login) .submit { width: 100%; padding: 12px 14px; border: none; border-radius: 999px; background: var(--azul); color: var(--paper); font-size: 14px; font-weight: 600; cursor: pointer; }
:where(.master-login) .submit:hover { background: var(--azul-escuro); }
:where(.master-login) .errors { background: #fbecea; border: 1px solid #ecc1b8; color: var(--danger); font-size: 13px; padding: 10px 12px; border-radius: 6px; margin-bottom: 20px; }
:where(.master-login) .errors ul { margin: 0; padding-left: 18px; }


/* ═══════════════════════════════════════════════════════════════════════
   5. PÁGINA DE ERRO 403 — body.tela-erro
   ═══════════════════════════════════════════════════════════════════════ */
body:where(.tela-erro) { margin: 0; font-family: 'Poppins', ui-sans-serif, system-ui, sans-serif; background: var(--paper); color: var(--ink); display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 20px; box-sizing: border-box; }
:where(.tela-erro) .caixa { max-width: 460px; background: #fff; border: 1px solid var(--borda-cartao); border-radius: 16px; box-shadow: var(--sombra); padding: 32px 24px; text-align: center; }
:where(.tela-erro) h1 { font-size: 19px; margin: 8px 0; }
:where(.tela-erro) p { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin: 0 0 18px; }
:where(.tela-erro) a { display: inline-block; background: var(--azul); color: #fff; padding: 10px 20px; border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; }
:where(.tela-erro) a:hover { background: var(--azul-escuro); }

/* ── Paginação das listas (partes/paginacao.blade.php) ── */
.paginacao { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; font-size: 13.5px; }
.paginacao-info { color: var(--ink-soft, #5b6478); }
.paginacao-botoes { display: flex; flex-wrap: wrap; gap: 4px; }
.paginacao .pag-item { min-width: 36px; height: 36px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--line, #e3e6ef); border-radius: 8px; background: #fff; color: var(--ink, #111c32); font: inherit; font-weight: 500;
    text-decoration: none; cursor: pointer; line-height: 1; }
.paginacao a.pag-item:hover, .paginacao button.pag-item:hover { border-color: var(--azul, #1c53e1); color: var(--azul, #1c53e1); }
.paginacao .pag-item.atual { background: var(--azul, #1c53e1); border-color: var(--azul, #1c53e1); color: #fff; cursor: default; }
.paginacao .pag-item.desativado { opacity: .45; cursor: default; }
.paginacao .pag-item.reticencias { border-color: transparent; background: transparent; cursor: default; padding: 0 4px; min-width: 0; }
.paginacao button.pag-item[disabled] { opacity: .6; }
@media (max-width: 600px) { .paginacao { justify-content: center; } .paginacao-info { width: 100%; text-align: center; } }

/* ── Senha: "Minha senha" no rodapé do menu e "Esqueci minha senha" no login ── */
:where(.sistema) .lateral-rodape .manual { display: flex; width: fit-content; }
:where(.sistema) .lateral-rodape .manual + .manual { margin-top: 6px; }
html.menu-mini:not(.menu-espiar) :where(.sistema) .lateral-rodape .manual { width: auto; }
.tela-acesso .link-esqueci { display: inline-block; margin-top: 6px; font-size: 12.5px; color: var(--azul, #1c53e1); text-decoration: none; }
.tela-acesso .link-esqueci:hover { text-decoration: underline; }
.tela-acesso .voltar-login { display: inline-block; margin-top: 14px; font-size: 13px; color: var(--azul, #1c53e1); text-decoration: none; }

/* ── OS com vários itens do cliente (ramos/itens/campos-os) ── */
:where(.sistema) .item-os-varios { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 4px; margin-bottom: 12px; background: var(--paper, #fff); }
:where(.sistema) .item-os-topo { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-soft); }
:where(.sistema) .adicionar-item-os { margin: 0 0 16px; }

/* ── Plano de ação por card com problema (partes/plano-acao): sistema calcula, IA explica ── */
.btn-plano-acao { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; flex: none;
    border: 1px solid var(--danger, #c0392b); background: var(--danger, #c0392b); color: #fff; border-radius: 50%; font-size: 15px; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 6px rgba(192, 57, 43, .3); transition: transform .15s; }
.btn-plano-acao:hover, .btn-plano-acao:focus-visible { transform: scale(1.1); }
/* Legenda ao passar o mouse (ou focar pelo teclado) */
.btn-plano-acao::after { content: attr(data-legenda); position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 50;
    background: var(--ink, #111c32); color: #fff; font-size: 12px; font-weight: 600; white-space: nowrap; padding: 5px 9px; border-radius: 6px;
    opacity: 0; pointer-events: none; transition: opacity .15s; }
.btn-plano-acao:hover::after, .btn-plano-acao:focus-visible::after { opacity: 1; }
.plano-modal { position: fixed; inset: 0; z-index: 100000; background: rgba(17, 28, 50, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.plano-modal[hidden] { display: none; }
.plano-caixa [hidden] { display: none !important; }
.plano-caixa { background: #fff; color: var(--ink, #111c32); width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; border-radius: 16px; padding: 20px 22px; box-shadow: 0 24px 64px rgba(17, 28, 50, .3); }
.plano-topo { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.plano-topo h2 { font-size: 18px; margin: 0; }
.plano-fechar { background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--ink-soft, #5b6478); }
.plano-resumo { margin: 0 0 12px; color: var(--danger, #c0392b); font-weight: 600; }
.plano-numeros { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 6px; }
.plano-numeros div { background: var(--fundo-2, #f4f6fb); border-radius: 10px; padding: 8px 10px; }
.plano-numeros small { display: block; font-size: 11.5px; color: var(--ink-soft, #5b6478); }
.plano-numeros strong { font-size: 15px; }
.plano-sub { font-size: 14px; margin: 16px 0 6px; }
.plano-sugestoes { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.5; }
.plano-sugestoes li { margin: 4px 0; }
.plano-tabela { overflow-x: auto; }
.plano-tabela table { width: 100%; border-collapse: collapse; font-size: 13px; }
.plano-tabela th, .plano-tabela td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--linha, #e5e8ef); white-space: nowrap; }
.plano-tabela th { font-size: 11.5px; color: var(--ink-soft, #5b6478); font-weight: 600; }
.plano-tabela td:first-child { white-space: normal; }
.plano-wa { color: #128c4b; font-weight: 600; }
.plano-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.plano-ia { margin-top: 8px; border-top: 1px dashed var(--linha, #e5e8ef); }
.plano-pensando { display: flex; align-items: center; gap: 14px; padding: 12px 4px; color: var(--ink-soft, #5b6478); }
.plano-pensando p { margin: 0; }
.plano-pensando img { border-radius: 50%; animation: plano-pulso 1.6s ease-in-out infinite; }
@keyframes plano-pulso { 50% { transform: scale(1.06); } }
.plano-texto { font-size: 14.5px; line-height: 1.55; }
.plano-texto h1, .plano-texto h2, .plano-texto h3 { font-size: 15px; margin: 12px 0 6px; }
.plano-texto ol, .plano-texto ul { padding-left: 22px; }
.plano-texto li { margin: 4px 0; }
.plano-carregando, .plano-resolvido { color: var(--ink-soft, #5b6478); }
.plano-erro { color: #b42318; font-weight: 500; }
.plano-aviso { font-size: 12px; color: var(--ink-soft, #5b6478); background: var(--fundo-2, #f4f6fb); border-radius: 8px; padding: 8px 10px; margin: 12px 0 0; }
.plano-acoes { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.dash-atencao { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px; border: 1px solid #ecc1b8; background: #fdf4f2; border-radius: 16px; }
.hero-plano { margin-top: -6px; }
.ind-kpi { position: relative; }
.ind-kpi:has(.btn-plano-acao) .r { padding-right: 32px; }
.ind-kpi .btn-plano-acao { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; font-size: 13px; }
@media (max-width: 640px) { .dash-atencao { display: flex; width: 100%; } }
.hero-plano .btn-plano-acao::after { background: #fff; color: var(--ink, #111c32); left: calc(100% + 8px); bottom: auto; top: 50%; transform: translateY(-50%); }
.ind-kpi .btn-plano-acao::after { left: auto; right: 0; transform: none; }

/* ── App instalável (partes/instalar-app): só aparece quando dá para instalar ── */
.instalar-app { display: none !important; }
html.pode-instalar:not(.no-app) .instalar-app, html.ios-instalar:not(.no-app) .instalar-app { display: inline-flex !important; align-items: center; gap: 6px; }
html:not(.pode-instalar):not(.ios-instalar) .link-instalar, html.no-app .link-instalar { display: none; }
.instalar-login { font-weight: 600; text-decoration: none; }
.instalar-ios { position: fixed; inset: 0; z-index: 100001; background: rgba(17, 28, 50, .5); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.instalar-ios[hidden] { display: none; }
.instalar-ios-caixa { background: #fff; color: #111c32; width: min(420px, 100%); border-radius: 18px; padding: 22px; text-align: center; box-shadow: 0 24px 64px rgba(17, 28, 50, .3); }
.instalar-ios-caixa img { border-radius: 14px; }
.instalar-ios-caixa h2 { font-size: 18px; margin: 10px 0 12px; }
.instalar-ios-caixa ol { text-align: left; padding-left: 22px; margin: 0 0 10px; font-size: 14.5px; line-height: 1.5; }
.instalar-ios-caixa li { margin: 6px 0; }
.instalar-ios-obs { font-size: 12.5px; color: #5b6478; margin: 0 0 14px; }
.instalar-ios-ok { background: #1d4ed8; color: #fff; border: 0; border-radius: 999px; padding: 10px 28px; font: inherit; font-weight: 600; cursor: pointer; }
/* Faixa "Use como app": só no celular, só quando dá para instalar, nunca dentro do app */
.faixa-instalar { display: none; }
@media (max-width: 820px) {
    html.pode-instalar:not(.no-app) .faixa-instalar, html.ios-instalar:not(.no-app) .faixa-instalar {
        display: flex; align-items: center; gap: 10px; position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 99990;
        background: #111c32; color: #fff; border-radius: 14px; padding: 10px 10px 10px 12px; box-shadow: 0 10px 30px rgba(17, 28, 50, .35); }
    .faixa-instalar img { border-radius: 9px; flex: none; }
    .faixa-instalar div { flex: 1; min-width: 0; line-height: 1.25; }
    .faixa-instalar strong { display: block; font-size: 14px; }
    .faixa-instalar span { display: block; font-size: 11.5px; color: #c7cfdd; }
    .faixa-instalar-btn { background: #1d4ed8; color: #fff; border: 0; border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; flex: none; }
    .faixa-instalar-x { background: none; border: 0; color: #c7cfdd; font-size: 15px; cursor: pointer; padding: 6px; flex: none; }
    /* a bolha do chat sobe para não ficar em cima da faixa */
    html.pode-instalar:not(.no-app) body:has(#faixa-instalar) .cs-bubble, html.ios-instalar:not(.no-app) body:has(#faixa-instalar) .cs-bubble { bottom: 100px !important; }
}
