/* Design system do painel admin — mesma identidade da página de vendas (Manrope + Fraunces, jade).
   Usado por todas as telas em /admin/*. O menu lateral é montado por /assets/admin.js. */

:root {
  color-scheme: light;
  --ink: #0d1c18;
  --ink-2: #122922;
  --ink-text: #eaf3ee;
  --ink-muted: #9db6ac;
  --ink-line: rgba(234, 243, 238, 0.1);

  --bg: #f6f4ee;
  --surface: #ffffff;
  --surface-2: #faf8f3;
  --text: #14231d;
  --muted: #5c6d64;
  --subtle: #8a9a91;
  --line: rgba(20, 35, 29, 0.1);
  --line-strong: rgba(20, 35, 29, 0.18);

  --brand: #0f6b49;
  --brand-500: #22a879;
  --brand-soft: rgba(34, 168, 121, 0.12);
  --brand-text: #ffffff;
  --gold: #e3a23c;

  --ok: #15803d;
  --ok-soft: rgba(21, 128, 61, 0.1);
  --warn: #b45309;
  --warn-soft: rgba(217, 119, 6, 0.12);
  --err: #c0262d;
  --err-soft: rgba(192, 38, 45, 0.09);
  --info-soft: rgba(37, 99, 235, 0.08);

  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(13, 28, 24, 0.05);
  --shadow: 0 1px 2px rgba(13, 28, 24, 0.04), 0 8px 24px -12px rgba(13, 28, 24, 0.14);
  --shadow-lg: 0 24px 64px -20px rgba(13, 28, 24, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sidebar: 248px;
  --font: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Fraunces', Georgia, serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0a1310;
    --surface: #111d19;
    --surface-2: #0e1815;
    --text: #e8f1ec;
    --muted: #9db0a7;
    --subtle: #718a7f;
    --line: rgba(234, 243, 238, 0.09);
    --line-strong: rgba(234, 243, 238, 0.16);
    --brand: #3ecb98;
    --brand-500: #3ecb98;
    --brand-soft: rgba(62, 203, 152, 0.13);
    --brand-text: #06110d;
    --ok: #4ade80;
    --ok-soft: rgba(74, 222, 128, 0.1);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, 0.1);
    --err: #f87171;
    --err-soft: rgba(248, 113, 113, 0.1);
    --info-soft: rgba(96, 165, 250, 0.1);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px -12px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.86em; background: var(--surface-2); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; }
:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* ---------- Shell ---------- */
.app { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--ink); color: var(--ink-text);
  display: flex; flex-direction: column; padding: 20px 14px;
}
.marca { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; text-decoration: none; color: inherit; }
.marca-logo {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #3ecb98, #0f6b49); color: #06110d; font-weight: 800; font-size: 0.95rem;
}
.marca { flex-direction: column; align-items: flex-start; gap: 4px; }
.marca-img { height: 38px; width: auto; display: block; }
.marca-nome { font-family: var(--serif); font-size: 1.05rem; line-height: 1.1; }
.marca-nome small { display: block; font-family: var(--font); font-size: 0.7rem; color: var(--ink-muted); letter-spacing: 0.04em; text-transform: uppercase; }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-titulo { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-muted); padding: 16px 10px 6px; opacity: 0.8; }
.nav a {
  display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px;
  color: var(--ink-text); text-decoration: none; font-size: 0.9rem; font-weight: 500; opacity: 0.82;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.nav a svg { width: 18px; height: 18px; flex: none; opacity: 0.85; }
.nav a:hover { background: rgba(234, 243, 238, 0.06); opacity: 1; }
.nav a.ativo { background: linear-gradient(90deg, rgba(62, 203, 152, 0.2), rgba(62, 203, 152, 0.07)); color: #fff; opacity: 1; font-weight: 700; box-shadow: inset 3px 0 0 #3ecb98; }
.nav a.ativo svg { color: #3ecb98; opacity: 1; }
.nav a .externo { margin-left: auto; width: 13px; height: 13px; opacity: 0.5; }
.nav a .alerta-saldo { margin-left: auto; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; display: inline-grid; place-items: center; font-size: 0.68rem; font-weight: 800; background: #f59e0b; color: #1f1300; }
.nav a .alerta-saldo.critico { background: #ef4444; color: #fff; animation: piscar-saldo 1.6s infinite; }
@keyframes piscar-saldo { 50% { opacity: 0.55; } }
.faixa-saldo { margin-bottom: 16px; align-items: center; }
.faixa-saldo .corpo a { font-weight: 700; color: inherit; }
.faixa-saldo > button { margin-left: auto; flex: none; }

.sidebar-rodape { margin-top: auto; padding-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.mini-status {
  display: block; text-decoration: none; color: var(--ink-text);
  background: var(--ink-2); border: 1px solid var(--ink-line); border-radius: 12px; padding: 10px 12px; font-size: 0.8rem;
}
.mini-status b { display: block; font-size: 0.72rem; color: var(--ink-muted); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; margin-bottom: 6px; }
.mini-status .linha-sessao { display: flex; align-items: center; gap: 8px; }
.mini-status .linha-sessao + .linha-sessao { margin-top: 3px; }

.main { min-width: 0; padding: 36px 44px 96px; }
.conteudo { max-width: 1080px; margin: 0 auto; }
.conteudo.estreito { max-width: 780px; }

.topo-mobile { display: none; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: min(290px, 86vw); z-index: 60;
    transform: translateX(-100%); transition: transform 0.25s var(--ease); box-shadow: var(--shadow-lg);
  }
  body.menu-aberto .sidebar { transform: none; }
  body.menu-aberto::after { content: ''; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 55; }
  .topo-mobile {
    display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 40;
    background: var(--ink); color: var(--ink-text); padding: 10px 14px;
  }
  .topo-mobile button {
    flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
    background: rgba(234, 243, 238, 0.08); border: 1px solid rgba(234, 243, 238, 0.14); color: #fff; padding: 0;
  }
  .topo-mobile button svg { width: 24px; height: 24px; display: block; }
  .topo-mobile button:active { background: rgba(234, 243, 238, 0.16); }
  .topo-mobile .marca { padding: 0; min-width: 0; }
  .topo-mobile .marca-img { height: 30px; }
  .topo-mobile .mini-pontos { margin-left: auto; display: flex; gap: 6px; }
  .main { padding: 22px 16px 96px; }
}

/* ---------- Cabeçalho de página ---------- */
.cabecalho { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.cabecalho h1 { font-family: var(--serif); font-weight: 500; font-size: 2.15rem; letter-spacing: -0.01em; margin: 0; line-height: 1.15; }
.cabecalho p { color: var(--muted); margin: 6px 0 0; max-width: 62ch; }
.cabecalho .acoes { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 600px) { .cabecalho h1 { font-size: 1.6rem; } }

.secao-titulo { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 34px 0 14px; flex-wrap: wrap; }
.secao-titulo h2 { font-size: 1.05rem; margin: 0; }
.secao-titulo p { margin: 2px 0 0; color: var(--muted); font-size: 0.86rem; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-sm); padding: 22px; }
.card + .card { margin-top: 16px; }
.card-cabeca { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-cabeca > div:first-child { flex: 1 1 220px; }
.card-cabeca h2, .card-cabeca h3 { margin: 0; font-size: 1.02rem; letter-spacing: -0.005em; }
.card-cabeca p { margin: 3px 0 0; color: var(--muted); font-size: 0.85rem; }
.grade-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grade-2 > .card + .card { margin-top: 0; }
.grade-2 + .card, .grade-2 + .grade-2, .card + .grade-2 { margin-top: 16px; }
@media (max-width: 760px) { .grade-2 { grid-template-columns: 1fr; } }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font: inherit; font-size: 0.88rem; font-weight: 700; line-height: 1;
  padding: 11px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  background: var(--surface); color: var(--text); border-color: var(--line-strong);
}
.btn:hover:not(:disabled) { border-color: var(--brand-500); color: var(--brand); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primario { background: var(--brand); color: var(--brand-text); border-color: var(--brand); }
.btn-primario:hover:not(:disabled) { background: #0c5a3d; color: #fff; border-color: #0c5a3d; }
@media (prefers-color-scheme: dark) { .btn-primario:hover:not(:disabled) { background: #5fd9ad; color: #06110d; border-color: #5fd9ad; } }
.btn-perigo { color: var(--err); }
.btn-perigo:hover:not(:disabled) { border-color: var(--err); color: var(--err); background: var(--err-soft); }
.btn-perigo-cheio { background: var(--err); border-color: var(--err); color: #fff; }
.btn-perigo-cheio:hover:not(:disabled) { background: #a11f25; border-color: #a11f25; color: #fff; }
.btn-texto { background: none; border-color: transparent; padding: 8px 10px; color: var(--muted); }
.btn-texto:hover:not(:disabled) { color: var(--brand); border-color: transparent; background: var(--brand-soft); }
.btn-pq { padding: 7px 11px; font-size: 0.8rem; border-radius: 8px; }
.btn-icone { padding: 8px; width: 36px; height: 36px; }
.btn-bloco { width: 100%; }
.btn .girando { width: 15px; height: 15px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar 0.7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- Formulários ---------- */
.campo { margin-bottom: 18px; }
.campo:last-child { margin-bottom: 0; }
.campo > label, .rotulo { display: block; font-size: 0.84rem; font-weight: 700; margin-bottom: 6px; }
.rotulo-linha { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rotulo-linha label { font-size: 0.84rem; font-weight: 700; }
.ajuda { color: var(--muted); font-size: 0.8rem; margin: 6px 0 0; }
.input, .campo input:not([type='checkbox']):not([type='radio']):not([type='range']), .campo select, .campo textarea, textarea.input, select.input {
  width: 100%; font: inherit; font-size: 0.92rem; color: var(--text);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 10px; padding: 10px 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.campo textarea, textarea.input { resize: vertical; min-height: 44px; line-height: 1.5; }
.input:focus, .campo input:focus, .campo select:focus, .campo textarea:focus, textarea.input:focus {
  outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-soft);
}
.campo.invalido input, .campo.invalido textarea { border-color: var(--err); }
.erro-campo { color: var(--err); font-size: 0.8rem; margin: 6px 0 0; }
.linha-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 600px) { .linha-form { grid-template-columns: 1fr; } }

.busca { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.busca svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--subtle); pointer-events: none; }
.busca input { width: 100%; font: inherit; font-size: 0.9rem; padding: 10px 12px 10px 36px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); }
.busca input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Interruptor (switch) */
.interruptor { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); cursor: pointer; }
.interruptor .texto { flex: 1; }
.interruptor strong { display: block; font-size: 0.92rem; }
.interruptor span { color: var(--muted); font-size: 0.82rem; }
.campo > label.interruptor { display: flex; margin-bottom: 0; font-weight: inherit; font-size: inherit; }
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex: none; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background 0.2s; pointer-events: none; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 0.2s var(--ease); }
.switch input:checked + i { background: var(--brand-500); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* Segmentado */
.segmentado { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmentado button { font: inherit; font-size: 0.83rem; font-weight: 600; border: 0; background: none; color: var(--muted); padding: 7px 12px; border-radius: 8px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; transition: background 0.15s, color 0.15s; }
.segmentado button:hover { color: var(--text); }
.segmentado button[aria-pressed='true'] { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }
.segmentado button[aria-pressed='true'] .contagem { background: var(--brand-soft); color: var(--brand); }
.segmentado .contagem { font-size: 0.72rem; background: var(--line); border-radius: 999px; padding: 1px 7px; }

/* Opções grandes (radio em card) */
.opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.opcao { position: relative; display: block; border: 1.5px solid var(--line-strong); border-radius: var(--radius-sm); padding: 14px 16px; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.opcao input { position: absolute; opacity: 0; }
.opcao strong { display: block; font-size: 0.92rem; }
.opcao span { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 3px; }
.opcao:has(input:checked) { border-color: var(--brand-500); background: var(--brand-soft); }
.opcao:has(input:focus-visible) { outline: 2px solid var(--brand-500); outline-offset: 2px; }

/* Faixa (range) */
.faixa { display: flex; align-items: center; gap: 12px; }
.faixa input[type='range'] { flex: 1; accent-color: var(--brand-500); }
.faixa output { font-variant-numeric: tabular-nums; font-size: 0.85rem; font-weight: 700; min-width: 3em; text-align: right; }

/* ---------- Selos / status ---------- */
.selo { display: inline-flex; align-items: center; gap: 6px; font-size: 0.74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; white-space: nowrap; background: var(--line); color: var(--muted); }
.selo.ok { background: var(--ok-soft); color: var(--ok); }
.selo.aviso { background: var(--warn-soft); color: var(--warn); }
.selo.erro { background: var(--err-soft); color: var(--err); }
.selo.marca { background: var(--brand-soft); color: var(--brand); }
.ponto { width: 8px; height: 8px; border-radius: 50%; background: var(--subtle); flex: none; display: inline-block; }
.ponto.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18); }
.ponto.aviso { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); animation: piscar 1.6s ease-in-out infinite; }
.ponto.erro { background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.18); }
@keyframes piscar { 50% { opacity: 0.45; } }

/* ---------- Avisos (banners) ---------- */
.alerta { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--radius-sm); padding: 13px 15px; font-size: 0.88rem; border: 1px solid var(--line); background: var(--surface-2); }
.alerta + .alerta { margin-top: 8px; }
.alerta .icone { flex: none; font-size: 1.05rem; line-height: 1.3; }
.alerta .corpo { flex: 1; min-width: 0; }
.alerta strong { display: block; }
.alerta.info { background: var(--info-soft); border-color: transparent; }
.alerta.ok { background: var(--ok-soft); border-color: transparent; }
.alerta.atencao { background: var(--warn-soft); border-color: transparent; }
.alerta.erro { background: var(--err-soft); border-color: transparent; }
.alerta .acoes { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 900px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--shadow-sm);
  background: radial-gradient(130% 100% at 100% 0%, var(--brand-soft), transparent 46%), var(--surface); transition: border-color 0.2s, box-shadow 0.2s; }
.kpi:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.kpi > span { display: block; color: var(--subtle); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.kpi b { display: block; font-size: 1.75rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.kpi small { display: block; color: var(--subtle); font-size: 0.76rem; margin-top: 3px; }
.kpi.destaque b { color: var(--warn); }

/* ---------- Tabela ---------- */
.tabela-wrap { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
table.tab { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.86rem; }
table.tab th { text-align: left; font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--subtle); padding: 10px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tab th:first-child { border-top-left-radius: 10px; }
table.tab th:last-child { border-top-right-radius: 10px; }
table.tab td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; transition: background 0.15s; }
table.tab tbody tr:hover td { background: var(--surface-2); }
table.tab tr:last-child td { border-bottom: 0; }
table.tab .num, table.tab .n { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Faixa escura (resumo do topo das páginas) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 24px 26px; margin-bottom: 30px; color: var(--ink-text);
  background: radial-gradient(120% 150% at 100% 0%, rgba(62, 203, 152, 0.24), transparent 55%), radial-gradient(80% 120% at 0% 100%, rgba(227, 162, 60, 0.1), transparent 60%), var(--ink);
  border: 1px solid rgba(62, 203, 152, 0.16); box-shadow: var(--shadow-lg); }
.hero-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px 28px; flex-wrap: wrap; }
.hero-rot { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.13em; text-transform: uppercase; color: var(--ink-muted); }
.hero-frase { display: flex; align-items: center; gap: 12px; margin: 8px 0 0; font-family: var(--serif); font-weight: 500; font-size: 1.45rem; line-height: 1.25; max-width: 40ch; }
.hero-frase .ponto { width: 10px; height: 10px; }
.hero-frase .alerta-txt { color: #ff9b9b; }
.hero-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.hero-num { padding: 14px 16px; border-radius: 14px; background: rgba(234, 243, 238, 0.05); border: 1px solid var(--ink-line); }
.hero-num span { display: block; font-size: 0.76rem; font-weight: 700; color: var(--ink-muted); }
.hero-num b { display: block; font-size: 1.7rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; color: #fff; }
.hero-num b small { font-size: 0.95rem; color: var(--ink-muted); font-weight: 700; }
.hero-num em { display: block; font-style: normal; font-size: 0.74rem; color: var(--ink-muted); margin-top: 8px; }
.hero-num.quente { border-color: rgba(245, 158, 11, 0.45); background: rgba(245, 158, 11, 0.1); }
.hero-num.quente b { color: #fbbf24; }
.hero-barra { height: 5px; border-radius: 999px; background: rgba(234, 243, 238, 0.1); margin-top: 10px; overflow: hidden; }
.hero-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #22a879, #3ecb98); }
.hero-barra i.meio { background: linear-gradient(90deg, #e3a23c, #f5c46b); }
.hero-barra i.alerta { background: linear-gradient(90deg, #ef4444, #f87171); }
.hero-link { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; border-radius: 10px; font-size: 0.84rem; font-weight: 700; text-decoration: none; color: #fff; background: rgba(234, 243, 238, 0.08); border: 1px solid var(--ink-line); transition: background 0.15s; white-space: nowrap; }
.hero-link:hover { background: rgba(234, 243, 238, 0.14); }
@media (max-width: 980px) { .hero-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
  .hero { padding: 20px 18px; border-radius: 18px; }
  .hero-frase { font-size: 1.2rem; }
  .hero-num { padding: 12px 13px; }
  .hero-num b { font-size: 1.4rem; }
}

/* ---------- Lista genérica ---------- */
.lista { display: flex; flex-direction: column; gap: 10px; }
.vazio { text-align: center; color: var(--muted); padding: 40px 20px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); }
.vazio .grande { font-size: 2rem; display: block; margin-bottom: 6px; }
.vazio strong { display: block; color: var(--text); font-size: 0.98rem; margin-bottom: 4px; }

.esqueleto { background: linear-gradient(90deg, var(--line) 25%, var(--surface-2) 50%, var(--line) 75%); background-size: 200% 100%; animation: brilho 1.3s infinite; border-radius: var(--radius); min-height: 84px; }
@keyframes brilho { to { background-position: -200% 0; } }

/* ---------- Menu suspenso (⋯) ---------- */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-itens {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 250px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px;
}
.menu-itens button { display: block; width: 100%; font: inherit; font-size: 0.86rem; text-align: left; background: none; border: 0; padding: 9px 10px; border-radius: 8px; color: var(--text); cursor: pointer; }
.menu-itens button:hover:not(:disabled) { background: var(--surface-2); }
.menu-itens button:disabled { opacity: 0.5; cursor: default; }
.menu-itens button small { display: block; color: var(--muted); font-size: 0.75rem; }
.menu-itens button.perigo { color: var(--err); }
.menu-itens button.perigo:hover { background: var(--err-soft); }
.menu-itens hr { border: 0; border-top: 1px solid var(--line); margin: 5px 4px; }
.menu-itens .grupo-rotulo { font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); padding: 8px 10px 4px; }

/* ---------- Diálogo ---------- */
dialog.dialogo {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; width: min(560px, calc(100vw - 24px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); max-height: calc(100vh - 32px);
}
dialog.dialogo::backdrop { background: rgba(8, 18, 15, 0.55); backdrop-filter: blur(2px); }
dialog.dialogo[open] { animation: surgir 0.2s var(--ease); }
@keyframes surgir { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.dialogo-corpo { padding: 24px; overflow-y: auto; max-height: calc(100vh - 140px); }
.dialogo-corpo h2 { margin: 0 0 6px; font-size: 1.15rem; }
.dialogo-corpo > p { color: var(--muted); margin: 0 0 16px; font-size: 0.9rem; white-space: pre-line; }
.dialogo-rodape { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; flex-wrap: wrap; }

/* ---------- Vídeos de ajuda (Admin.enviarVideoDeAjuda: ficha do cliente e Vigia) ---------- */
dialog.dialogo-videos { width: min(680px, calc(100vw - 24px)); }
.va-grade { display: grid; grid-template-columns: minmax(0, 1fr) 128px; gap: 14px; align-items: start; }
.va-lista { display: grid; gap: 8px; }
.va-item { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); cursor: pointer; }
.va-item:hover { background: var(--surface-2); }
.va-item:has(input:checked) { border-color: var(--brand-500); background: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-500); }
.va-item input { flex: none; margin: 3px 0 0; accent-color: var(--brand-500); }
.va-texto { display: grid; gap: 3px; min-width: 0; }
.va-texto b { font-size: 0.9rem; }
.va-texto small { font-size: 0.78rem; line-height: 1.4; color: var(--muted); }
.va-meta { display: flex; flex-wrap: wrap; gap: 2px 10px; font-size: 0.74rem; color: var(--subtle); font-variant-numeric: tabular-nums; }
.va-ja { color: var(--warn); font-weight: 700; }
.va-previa { width: 128px; aspect-ratio: 9 / 16; border-radius: 12px; background: #0b141a; object-fit: cover; }
.va-campo { margin-top: 16px; }
.va-conta { float: right; font-weight: 500; color: var(--subtle); font-variant-numeric: tabular-nums; }
.va-conta.cheio { color: var(--err); }
.va-dica, .va-erro { margin: 6px 0 0; font-size: 0.78rem; color: var(--muted); }
.va-erro { color: var(--err); font-weight: 700; }
.dialogo-videos .dialogo-rodape [data-r='padrao'] { margin-right: auto; }
@media (max-width: 560px) {
  .va-grade { grid-template-columns: minmax(0, 1fr); }
  .va-previa { width: 112px; justify-self: center; }
}

/* ---------- Toasts ---------- */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 32px)); }
.toast {
  display: flex; gap: 10px; align-items: flex-start; background: var(--ink); color: var(--ink-text);
  border-radius: 12px; padding: 12px 14px; font-size: 0.88rem; box-shadow: var(--shadow-lg);
  animation: entrar 0.25s var(--ease);
}
.toast .icone { flex: none; }
.toast.saindo { opacity: 0; transform: translateY(6px); transition: all 0.2s; }
@keyframes entrar { from { opacity: 0; transform: translateY(10px); } }
@media (max-width: 600px) { .toasts { left: 16px; right: 16px; bottom: 16px; max-width: none; } }

/* ---------- Barra de salvar fixa ---------- */
.barra-salvar {
  position: sticky; bottom: 16px; z-index: 20; margin-top: 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: var(--ink); color: var(--ink-text); border-radius: 14px; padding: 12px 14px 12px 18px; box-shadow: var(--shadow-lg);
  animation: entrar 0.25s var(--ease);
}
.barra-salvar .btn-texto { color: var(--ink-muted); }
.barra-salvar .btn-texto:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.barra-salvar .btn-primario { background: #3ecb98; border-color: #3ecb98; color: #06110d; }

/* ---------- Bolha estilo WhatsApp (prévia) ---------- */
.previa-wa { background: #e7ded3; border-radius: 12px; padding: 12px; }
@media (prefers-color-scheme: dark) { .previa-wa { background: #0b141a; } }
.bolha {
  position: relative; background: #fff; color: #111b21; max-width: 92%; border-radius: 0 10px 10px 10px;
  padding: 8px 10px 18px; font-size: 0.87rem; line-height: 1.45; white-space: pre-wrap; word-wrap: break-word;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.08);
}
@media (prefers-color-scheme: dark) { .bolha { background: #202c33; color: #e9edef; } }
.bolha::after { content: '12:00'; position: absolute; right: 8px; bottom: 3px; font-size: 0.66rem; color: #667781; }
.bolha .ph { background: rgba(34, 168, 121, 0.16); color: #0f6b49; border-radius: 4px; padding: 0 3px; font-weight: 600; }
@media (prefers-color-scheme: dark) { .bolha .ph { color: #3ecb98; } }

/* ---------- Utilitários ---------- */
.mudo { color: var(--muted); }
.pq { font-size: 0.82rem; }
.linha-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.entre { justify-content: space-between; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

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

/* App "ZayDuo Admin" (mobile-admin/): o admin dentro do app no iPhone/Android ocupa a tela toda (viewport-fit=cover);
   as margens do entalhe e da barra de baixo vêm de env(safe-area-inset-*). Classe posta por admin.js. */
html.no-app .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
html.no-app .sidebar { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
html.no-app .toasts { bottom: calc(20px + env(safe-area-inset-bottom)); }
@media (max-width: 900px) {
  html.no-app .topo-mobile { padding-top: calc(10px + env(safe-area-inset-top)); padding-left: calc(14px + env(safe-area-inset-left)); padding-right: calc(14px + env(safe-area-inset-right)); }
}
@media (min-width: 901px) {
  html.no-app .main { padding-top: calc(36px + env(safe-area-inset-top)); }
}

/* Diálogo de cobrança (Admin.gerarCobranca): ficha do cliente e Vendas. */
.opc-cob { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 12px; cursor: pointer; }
.opc-cob:has(input:checked) { border-color: var(--brand-500); background: var(--brand-soft); }
.opc-cob input { margin-top: 3px; }
.opc-cob span { display: grid; gap: 2px; font-size: .88rem; }
