/* ═══════════════════════════════════════════════════════════════
   Prumo — tema "Liquid Glass", o mesmo padrão do Orbit ERP e do
   SafeFlow (vidro sobre manchas de cor, menu lateral flutuante,
   botões em pílula). A cor própria do Prumo é o laranja.
   Compartilhado pelo app de campo (/app) e pela administração.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --lg-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", "Segoe UI", system-ui, sans-serif;
  --ink: #1f1a17; --ink-2: #6b5f57; --ink-3: #a3968c;
  --line: rgba(80, 45, 20, .10); --line-strong: rgba(80, 45, 20, .18); --grid: rgba(80, 45, 20, .07);
  --accent: #e8590c; --accent-dark: #c2410c; --accent-ink: #ffffff;
  --accent-soft: rgba(232, 89, 12, .12);
  --grad: linear-gradient(135deg, #f76707, #f59f00);
  --surface: rgba(255, 255, 255, .56); --surface-2: rgba(255, 255, 255, .5); --bg: #f4eee8;
  --ok: #2b8a3e; --ok-soft: rgba(43, 138, 62, .13);
  --warn: #b45309; --warn-soft: rgba(245, 159, 0, .17);
  --danger: #d43d42; --danger-soft: rgba(229, 72, 77, .13);
  --info: #2f6fd6; --info-soft: rgba(47, 128, 237, .13);
  --radius: 22px;
  /* materiais: quanto maior a superfície, mais "espessa" (mais blur e sombra) */
  --glass: rgba(255, 255, 255, .56);
  --glass-strong: rgba(255, 255, 255, .74);
  --glass-thick: rgba(255, 252, 249, .88);
  --glass-edge: rgba(255, 255, 255, .78);
  --glass-blur: blur(26px) saturate(185%);
  --glass-hi: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 0 0 1px rgba(255, 255, 255, .28);
  --shadow: var(--glass-hi), 0 1px 2px rgba(70, 40, 20, .05), 0 14px 34px -18px rgba(70, 40, 20, .28);
  --shadow-lg: var(--glass-hi), 0 2px 4px rgba(70, 40, 20, .06), 0 26px 50px -22px rgba(70, 40, 20, .38);
  --ease: cubic-bezier(.32, .72, 0, 1);
  --sidebar-w: 248px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
html, body { margin: 0; }
body {
  font: 15px/1.5 var(--lg-font); color: var(--ink); letter-spacing: -.006em;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(900px 620px at 90% -8%, rgba(247, 103, 7, .22), transparent 62%),
    radial-gradient(760px 560px at 6% 2%, rgba(245, 159, 0, .22), transparent 60%),
    radial-gradient(900px 700px at 60% 110%, rgba(47, 128, 237, .14), transparent 60%),
    radial-gradient(700px 520px at -6% 96%, rgba(247, 103, 7, .14), transparent 58%),
    var(--bg);
  background-attachment: fixed;
  min-height: 100vh;
}
* { scrollbar-color: rgba(80, 45, 20, .22) transparent; }
a { color: var(--accent-dark); text-decoration: none; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 1.6rem; letter-spacing: -.028em; } h2 { font-size: 1.05rem; letter-spacing: -.012em; } h3 { font-size: .95rem; }
.muted { color: var(--ink-2); } .small { font-size: .86rem; } .tiny { font-size: .75rem; }
.num { font-variant-numeric: tabular-nums; }

/* ── Marca ── */
.marca { display: flex; align-items: center; gap: .55rem; font-weight: 750; font-size: 1.12rem; color: var(--ink); letter-spacing: -.03em; }
.marca svg { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 6px 10px rgba(232, 89, 12, .35)); }

/* ── Layout: menu lateral de vidro flutuante + conteúdo ── */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 12px; flex: none; width: var(--sidebar-w);
  margin: 12px 0 12px 12px; height: calc(100vh - 24px); border-radius: 28px;
  display: flex; flex-direction: column; z-index: 40;
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-hi), 0 20px 46px -24px rgba(70, 40, 20, .42);
}
.sidebar-brand { padding: 22px 18px 16px; border-bottom: 1px solid var(--line); }
.brand-sub { display: block; color: var(--ink-2); font-size: .72rem; font-weight: 500; margin-top: .3rem; padding-left: 2.4rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; }
.nav-grupo { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); padding: 14px 12px 5px; }
.nav-item {
  display: flex; align-items: center; gap: .7rem; color: #4a3f38; border-radius: 14px; padding: 9px 12px;
  font-size: .9rem; font-weight: 500; transition: background .2s, color .2s, transform .12s;
}
.nav-item svg, .nav-item i { width: 18px; height: 18px; flex: none; color: #8a7a6e; font-size: 1.05rem; }
.nav-item:hover { background: rgba(255, 255, 255, .55); color: var(--ink); }
.nav-item:active { transform: scale(.98); }
.nav-item.ativo { background: rgba(255, 255, 255, .92); color: var(--ink); font-weight: 600;
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(70, 40, 20, .08), 0 10px 22px -14px rgba(70, 40, 20, .45); }
.nav-item.ativo svg, .nav-item.ativo i { color: var(--accent); }
.nav-item .contador { margin-left: auto; background: var(--grad); color: #fff; border-radius: 999px; font-size: .7rem; font-weight: 700; padding: 0 .45rem; line-height: 1.5; }
.sidebar-footer { border-top: 1px solid var(--line); padding: 12px; }
.user-chip { display: flex; align-items: center; gap: .65rem; padding: 6px 6px 10px; }
.user-avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), 0 6px 14px -6px rgba(232, 89, 12, .7); }
.user-nome { font-weight: 650; font-size: .88rem; line-height: 1.2; }
.user-papel { font-size: .68rem; color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.btn-logout { display: block; width: 100%; text-align: left; border: 1px solid var(--line); color: var(--ink-2); border-radius: 12px; background: rgba(255, 255, 255, .35);
  padding: .45rem .8rem; font: inherit; font-size: .86rem; cursor: pointer; }
.btn-logout:hover { background: rgba(255, 255, 255, .85); color: var(--ink); }
.main { flex: 1; min-width: 0; padding: 28px 32px 48px; }
.conteudo { max-width: 1120px; margin: 0 auto; }

/* topo no celular + menu deslizante */
.mobile-topbar { display: none; }
.sidebar-overlay { display: none; }
@media (max-width: 900px) {
  .layout { display: block; }
  .mobile-topbar {
    position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: .5rem;
    padding: calc(.5rem + env(safe-area-inset-top)) 16px .5rem;
    background: var(--glass-strong); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-edge); box-shadow: 0 8px 20px -16px rgba(70, 40, 20, .5);
  }
  .mobile-topbar .marca { justify-self: center; font-size: 1rem; }
  .mobile-topbar .marca svg { width: 26px; height: 26px; }
  .mobile-menu-btn { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .7); display: grid; place-items: center; cursor: pointer; color: var(--ink); }
  .sidebar { position: fixed; left: 0; top: 0; margin: 10px; height: calc(100vh - 20px); transform: translateX(calc(-100% - 20px)); transition: transform .38s var(--ease); }
  .sidebar.aberta { transform: none; }
  .sidebar-overlay.aberta { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(40, 20, 10, .25); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .main { padding: 18px 16px 48px; }
}

/* ── Cabeçalho de página (como o "Olá, Nome" do SafeFlow) ── */
.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.cabecalho h1 { margin: 0; }
.pagina-eyebrow { font-size: .82rem; font-weight: 600; color: var(--ink-2); margin-bottom: .15rem; }
.pagina-sub { color: var(--ink-2); font-size: .9rem; margin-top: .2rem; }
.acoes-pagina { display: flex; gap: .5rem; flex-wrap: wrap; }

/* ── Botões em pílula ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 40px; padding: 0 1.05rem; border-radius: 999px; font: inherit; font-weight: 600; letter-spacing: -.005em; cursor: pointer;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); color: var(--ink);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--glass-hi), 0 6px 16px -10px rgba(70, 40, 20, .35);
  transition: transform .12s ease-out, box-shadow .2s, background .2s;
}
.btn:hover { background: #fff; }
.btn:active { transform: scale(.97); }
.btn-primario { background: var(--grad); border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 10px 22px -12px rgba(232, 89, 12, .85); }
.btn-primario:hover { background: linear-gradient(135deg, #e8590c, #f08c00); }
.btn-perigo { color: var(--danger); }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.btn-ghost:hover { background: rgba(255, 255, 255, .6); }
.btn-bloco { width: 100%; }
.btn-sm { min-height: 32px; padding: 0 .8rem; font-size: .84rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn svg, .btn i { width: 17px; height: 17px; font-size: 1rem; }

/* ── Formulários ── */
label { display: block; font-weight: 600; font-size: .82rem; color: var(--ink-2); margin-bottom: .3rem; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .8rem; border: 1px solid rgba(80, 45, 20, .13); border-radius: 13px;
  background: rgba(255, 255, 255, .72); color: var(--ink); font: inherit; font-size: 16px;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; background: #fff; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232, 89, 12, .15); }
input[type=checkbox], input[type=radio] { width: 19px; min-height: 19px; height: 19px; accent-color: var(--accent); box-shadow: none; }
.campo { margin-bottom: 1rem; }
.grade-2 { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.grade-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
@media (max-width: 560px) { .grade-2, .grade-3 { grid-template-columns: 1fr; } }

/* ── Superfícies de vidro ── */
.card {
  background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem 1.25rem;
}
.card + .card { margin-top: .85rem; }
.card .card { background: rgba(255, 255, 255, .5); -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-radius: 16px; }
.card-titulo { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-bottom: .75rem; }
.card-titulo h2 { margin: 0; }

/* indicadores (cartões de número, como no SafeFlow) */
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 1rem; }
.stat-card { background: var(--glass); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-edge); border-radius: 20px; box-shadow: var(--shadow); padding: 15px 18px; transition: transform .3s var(--ease); color: var(--ink); }
a.stat-card:hover { transform: translateY(-2px); }
.stat-rotulo { display: flex; align-items: center; gap: .45rem; font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.stat-rotulo .ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.ponto.ok { background: var(--ok); } .ponto.warn { background: #f59f00; } .ponto.danger { background: var(--danger); } .ponto.info { background: var(--info); }
.stat-valor { font-size: 2rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: .2rem; }
.stat-sub { font-size: .78rem; color: var(--ink-2); }
@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat-card { padding: 12px 14px; border-radius: 18px; }
  .stat-valor { font-size: 1.6rem; }
  .stat-rotulo { font-size: .74rem; }
}

/* ── Selos ── */
.selo { display: inline-flex; align-items: center; gap: .3rem; padding: .14rem .6rem; border-radius: 999px; font-size: .74rem; font-weight: 650; white-space: nowrap; }
.selo-rascunho { background: rgba(80, 45, 20, .07); color: var(--ink-2); }
.selo-enviado { background: var(--warn-soft); color: var(--warn); }
.selo-assinado { background: var(--ok-soft); color: var(--ok); }
.selo-pendente { background: var(--info-soft); color: var(--info); }
.selo-erro { background: var(--danger-soft); color: var(--danger); }

/* ── Avisos ── */
.aviso { padding: .75rem 1rem; border-radius: 16px; margin-bottom: 1rem; font-size: .92rem; border: 1px solid var(--glass-edge);
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.aviso-ok { background: var(--ok-soft); color: var(--ok); }
.aviso-erro { background: var(--danger-soft); color: var(--danger); }
.aviso-aviso { background: var(--warn-soft); color: var(--warn); }
.aviso-info { background: var(--info-soft); color: var(--info); }

/* ── Tabelas: sem grade vertical, divisórias suaves ── */
.tabela { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tabela th { text-align: left; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-2); font-weight: 650;
  background: rgba(255, 255, 255, .4); border-bottom: 1px solid var(--line); }
.tabela th, .tabela td { padding: .7rem .75rem; vertical-align: middle; }
.tabela td { border-bottom: 1px solid var(--grid); font-variant-numeric: tabular-nums; }
.tabela tbody tr:last-child td { border-bottom: 0; }
.tabela tbody tr:hover { background: rgba(255, 255, 255, .5); }
.card.rolagem-x { padding: 0; overflow-x: auto; }
.card.rolagem-x .tabela th:first-child, .card.rolagem-x .tabela td:first-child { padding-left: 1.25rem; }
.card.rolagem-x .tabela th:last-child, .card.rolagem-x .tabela td:last-child { padding-right: 1.25rem; }

/* ── Abas: controle segmentado ── */
.abas { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(80, 45, 20, .07); box-shadow: inset 0 1px 2px rgba(70, 40, 20, .08); }
.aba { border: 0; background: transparent; border-radius: 999px; padding: .4rem 1rem; min-height: 34px; font: inherit; font-size: .84rem; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background .25s var(--ease), color .2s, box-shadow .25s; }
.aba:hover { color: var(--ink); background: rgba(255, 255, 255, .5); }
.aba.ativa { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(70, 40, 20, .1), 0 6px 14px -8px rgba(70, 40, 20, .45); }

/* ── Login ── */
.tela-login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.tela-login .card { width: 100%; max-width: 400px; padding: 2rem; border-radius: 28px; background: var(--glass-thick); box-shadow: var(--shadow-lg); }

/* ── Telas públicas: login, cadastro, páginas legais ── */
.auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 56px 16px 24px; position: relative; }
.auth-voltar { position: absolute; top: 18px; left: 20px; color: var(--ink-2); font-weight: 600; font-size: .88rem; }
.auth-caixa { width: 100%; max-width: 420px; padding: 2rem 1.9rem; border-radius: 28px; background: var(--glass-thick);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); border: 1px solid var(--glass-edge); box-shadow: var(--shadow-lg); }
.auth-caixa.auth-larga { max-width: 760px; }
.auth-marca { margin-bottom: 1.4rem; }
.auth-caixa h1 { margin-bottom: .3rem; }
.auth-sub { color: var(--ink-2); margin: 0 0 1.3rem; }
.auth-alternativa { text-align: center; margin-top: 1.3rem; font-size: .9rem; color: var(--ink-2); }
.auth-rodape { margin-top: 1.2rem; font-size: .8rem; color: var(--ink-3); }
.auth-rodape a { color: var(--ink-2); }
.rotulo-linha { display: flex; justify-content: space-between; align-items: baseline; }
.rotulo-linha a { font-weight: 600; font-size: .8rem; }
.isca { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.etapa-titulo { display: flex; align-items: center; gap: .55rem; font-weight: 700; margin: 1.3rem 0 .75rem; letter-spacing: -.01em; }
.etapa-titulo span { width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: .78rem; }
.aceite { display: flex; gap: .6rem; align-items: flex-start; font-weight: 500; color: var(--ink); font-size: .9rem; margin-top: .3rem; }
.aceite input { margin-top: .15rem; }
.texto-legal h2 { margin-top: 1.4rem; font-size: 1rem; }
.texto-legal p { color: #3d342e; line-height: 1.65; }
@media (max-width: 560px) { .auth-caixa { padding: 1.5rem 1.15rem; border-radius: 24px; } }

/* escolha de plano no cadastro */
.planos-escolha { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .6rem; margin-bottom: .8rem; }
.plano-opcao { position: relative; display: block; margin: 0; cursor: pointer; color: var(--ink); font-weight: 500; }
.plano-opcao input { position: absolute; opacity: 0; }
.plano-opcao .plano-corpo { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border-radius: 18px; background: rgba(255, 255, 255, .6);
  border: 1.5px solid var(--glass-edge); box-shadow: var(--glass-hi); transition: border-color .2s, box-shadow .2s; height: 100%; }
.plano-opcao input:checked + .plano-corpo { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(232, 89, 12, .14); background: #fff; }
.plano-opcao input:focus-visible + .plano-corpo { outline: 2px solid var(--accent); outline-offset: 2px; }
.plano-preco { font-size: 1.5rem; font-weight: 750; letter-spacing: -.03em; }
.plano-preco small { font-size: .8rem; font-weight: 600; color: var(--ink-2); letter-spacing: 0; }
.plano-limites { font-size: .78rem; color: var(--ink-2); }
.plano-selo { align-self: flex-start; background: var(--grad); color: #fff; font-size: .68rem; font-weight: 700; border-radius: 999px; padding: .1rem .55rem; margin-bottom: .2rem; }

/* planos na assinatura e no painel super */
.planos-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.plano-card { position: relative; display: flex; flex-direction: column; gap: .35rem; padding: 1.2rem; border-radius: 20px; background: rgba(255, 255, 255, .55); border: 1.5px solid var(--glass-edge); }
.plano-card.atual { border-color: var(--accent); background: #fff; }
.plano-card h3 { margin: 0; font-size: 1.05rem; }
.plano-card form { margin-top: auto; }
.plano-itens { list-style: none; padding: 0; margin: .3rem 0 .9rem; font-size: .88rem; }
.plano-itens li { padding: .22rem 0 .22rem 1.3rem; position: relative; }
.plano-itens li::before { content: ""; position: absolute; left: 0; top: .55rem; width: 10px; height: 6px; border-left: 2px solid var(--ok); border-bottom: 2px solid var(--ok); transform: rotate(-45deg); }
.plano-edicao { margin: 0 !important; }
.check-linha { display: flex; gap: .55rem; align-items: center; font-weight: 500; color: var(--ink); margin: .35rem 0; }

/* uso do plano */
.stat-de { font-size: 1rem; color: var(--ink-3); font-weight: 600; }
.barra-uso { height: 7px; border-radius: 99px; background: rgba(80, 45, 20, .08); overflow: hidden; margin-top: .55rem; }
.barra-uso > div { height: 100%; background: var(--grad); border-radius: 99px; }
.faixa-teste { margin-bottom: 1rem; padding: .6rem 1rem; border-radius: 14px; background: var(--info-soft); color: var(--info); font-size: .88rem; font-weight: 600; border: 1px solid var(--glass-edge); }
.faixa-teste a { color: inherit; text-decoration: underline; }

/* painel super */
.modo-super .sidebar { box-shadow: var(--glass-hi), 0 0 0 2px rgba(47, 111, 214, .18), 0 20px 46px -24px rgba(70, 40, 20, .42); }
.filtros { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; padding: .8rem; }
.filtros input { flex: 1; min-width: 200px; }
.filtros select { width: auto; }
.grade-super { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: .85rem; }
.grade-super > .card { margin: 0; }
@media (max-width: 900px) { .grade-super { grid-template-columns: 1fr; } }
.tabela-dados th { width: 40%; background: transparent; text-transform: none; letter-spacing: 0; font-size: .82rem; }
.linha-acao { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; margin-bottom: .7rem; }
.linha-acao input, .linha-acao select { flex: 1; min-width: 140px; width: auto; }
.zona-perigo { border-color: rgba(212, 61, 66, .3); }
.voltar-link { display: inline-block; color: var(--ink-2); font-weight: 600; font-size: .86rem; margin-bottom: .6rem; }
code { font-size: .85em; background: rgba(80, 45, 20, .07); padding: .1rem .35rem; border-radius: 6px; }
.card .lista-titulo, .card-titulo.lista-titulo { padding: 1rem 1.25rem .4rem; margin: 0; }
