/* ================= GeniAI Studio — painel ================= */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/tpl/audiobot/fonts/geist-latin.woff2") format("woff2"); }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 400 500; font-display: swap;
  src: url("/tpl/audiobot/fonts/geist-mono-latin.woff2") format("woff2"); }
@font-face { font-family: "Inter Tight"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/tpl/audiobot/fonts/inter-tight-latin.woff2") format("woff2"); }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #FAFAF7; --bg-2: #f1f2ea; --surface: #fff; --surface-2: #f6f7f0;
  --ink: #0A1628; --ink-body: #26324a; --muted: #5b6478; --navy: #0A1628;
  --lime: #B8FF3D; --lime-ink: #4f7d14; --lime-soft: rgba(184,255,61,.22);
  --border: rgba(10,22,40,.11); --border-strong: rgba(10,22,40,.2);
  --danger: #c0392b; --danger-soft: rgba(192,57,43,.08); --ok: #2e7d32;
  --shadow-sm: 0 1px 2px rgba(10,22,40,.05), 0 10px 24px -18px rgba(10,22,40,.22);
  --shadow: 0 2px 10px rgba(10,22,40,.06), 0 30px 60px -32px rgba(10,22,40,.24);
  --side-bg: #0A1628;                   /* fundo do menu lateral */
  --bar-bg: rgba(250,250,247,.92);      /* fundo da barra superior */
  --zebra: rgba(10,22,40,.012);         /* linha par da tabela */
  --hover: rgba(10,22,40,.015);
  --sel-bg: #0A1628; --sel-fg: #fff;    /* estado selecionado (chip, página) */
  --ok-bg: rgba(184,255,61,.22); --ok-bd: rgba(95,140,20,.3); --ok-fg: #33520c;
  --err-bg: rgba(192,57,43,.08); --err-bd: rgba(192,57,43,.28); --err-fg: #8e2b1f;
  --info-bg: #eef3fb; --info-bd: #cfdcf1; --info-fg: #24406e;
  --warn-bg: #fff4e0; --warn-bd: #f0d9a8; --warn-fg: #8a5a00;
  --r: 12px; --r-lg: 16px;
  --font-display: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter Tight", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Geist Mono", ui-monospace, SFMono-Regular, monospace;
  --sidebar: 244px;
}
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font-body); background: var(--bg); color: var(--ink-body); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
h1, h2, h3, h4, legend { font-family: var(--font-display); color: var(--ink); line-height: 1.18; font-weight: 650; }
::selection { background: var(--lime-soft); }

/* ---------------- layout ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar) 1fr; min-height: 100vh; }
.side { background: var(--side-bg); color: #e7ecf4; padding: 20px 14px; display: flex; flex-direction: column; gap: 18px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side__brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 700; color: #fff; font-size: 15.5px; letter-spacing: -.01em; padding: 4px 8px 0; text-decoration: none; }
.side__brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 4px rgba(184,255,61,.16); }
.side__group { display: grid; gap: 2px; }
.side__label { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: rgba(231,236,244,.42); padding: 8px 10px 4px; }
/* grupo onde você está: rótulo no verde da marca */
.side__label.on { color: var(--lime); }
.side a.nav, .side button.nav { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: rgba(231,236,244,.82); text-decoration: none; font-size: 14px; border: 0; background: none; width: 100%; text-align: left; cursor: pointer; font-family: inherit; }
.side a.nav:hover, .side button.nav:hover { background: rgba(255,255,255,.07); color: #fff; }
.side a.nav.on { background: rgba(184,255,61,.14); color: #fff; box-shadow: inset 2px 0 0 var(--lime); }
.side a.nav svg, .side button.nav svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
/* filtro do menu */
.side__busca { position: relative; padding: 0 4px; }
.side__busca svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px;
  fill: none; stroke: rgba(231,236,244,.5); stroke-width: 1.9; stroke-linecap: round; pointer-events: none; }
.side__busca input { width: 100%; padding: 8px 10px 8px 34px; border-radius: 9px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06); color: #fff; font: 400 13px/1.3 var(--font-body); }
.side__busca input::placeholder { color: rgba(231,236,244,.45); }
.side__busca input:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.side__semnada { padding: 6px 12px; font-size: 12.5px; color: rgba(231,236,244,.55); }
.side a.nav.oculto, .side .side__group.oculto { display: none; }
/* rolagem do menu e da árvore de abrangência: fina, quase invisível, aparece ao passar o mouse.
   Chrome/Edge/Firefox usam scrollbar-width/color; Safari usa os pseudo-elementos -webkit-. */
.side, .abr__lista { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,.12) transparent; }
.side:hover, .abr__lista:hover { scrollbar-color: rgba(255,255,255,.28) transparent; }
.side::-webkit-scrollbar, .abr__lista::-webkit-scrollbar { width: 6px; }
.side::-webkit-scrollbar-track, .abr__lista::-webkit-scrollbar-track { background: transparent; }
.side::-webkit-scrollbar-thumb, .abr__lista::-webkit-scrollbar-thumb { background: rgba(255,255,255,.12); border-radius: 999px; }
.side:hover::-webkit-scrollbar-thumb, .abr__lista:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); }
.side::-webkit-scrollbar-thumb:hover, .abr__lista::-webkit-scrollbar-thumb:hover { background: rgba(184,255,61,.5); }

.side__foot { margin-top: auto; border-top: 1px solid rgba(255,255,255,.1); padding-top: 12px; font-size: 12.5px; color: rgba(231,236,244,.6); }
.orgpick { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; border-radius: 10px; padding: 9px 10px; width: 100%; font-family: inherit; font-size: 13.5px; }
.orgpick option { color: #111; }

.main { min-width: 0; display: flex; flex-direction: column; }
/* barra superior fixa: acompanha a rolagem em qualquer tela */
.topbar { display: flex; align-items: center; gap: 14px; padding: 12px 26px; border-bottom: 1px solid var(--border);
  background: var(--bar-bg); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 40;
  flex-wrap: wrap; min-height: 62px; }
.topbar__acoes { display: flex; align-items: center; gap: 10px; }
/* no celular, as ações do topo (botões da tela, AudioCash, tema, avatar) quebram linha em vez de empurrar a página para o lado */
@media (max-width: 600px) { .topbar__acoes { flex-wrap: wrap; justify-content: flex-end; max-width: 100%; min-width: 0; } }
.topbar h1 { font-size: 19px; letter-spacing: -.015em; }
.topbar .sub { color: var(--muted); font-size: 13px; }
.topbar .spacer { flex: 1; }
/* botão "?" ao lado do título: abre o texto de ajuda da tela/aba (src/lib/ajuda.js) */
.ajuda-btn { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-left: 6px; vertical-align: 2px;
  border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--muted);
  font: 700 13px/1 inherit; cursor: pointer; }
.ajuda-btn:hover, .ajuda-btn:focus-visible { color: var(--ink-body); border-color: var(--muted); }
.modal-ajuda { max-width: 560px; width: calc(100% - 32px); background: var(--surface); color: var(--ink-body); }
.modal-ajuda .card__head { display: flex; align-items: center; gap: 8px; }
.modal-ajuda .card__head .spacer { flex: 1; }
.modal-ajuda__texto h4 { margin: 0 0 4px; font-size: 14px; }
.modal-ajuda__texto ul { margin: 0 0 12px; padding-left: 20px; }
.modal-ajuda__texto li + li { margin-top: 6px; }
.modal-ajuda__texto p { margin: 0; }
/* aba Motivos: onde cada motivo vale (desativação, rejeição, avaria no recebimento) */
.motivo-usos { border: 0; padding: 0; margin: 0; display: flex; gap: 4px 14px; flex-wrap: wrap; min-width: 0; }
.content { padding: 26px; max-width: 1240px; width: 100%; }
.content.narrow { max-width: 760px; }
/* telas de cadastro ocupam toda a largura útil */
.content.full { max-width: none; }

/* ---------------- componentes ---------------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card + .card { margin-top: 16px; }
/* dentro de grades, cartões não empilham: a margem desalinharia as caixas */
.grid > .card + .card, .cad-kpis > .card + .card, .cad-kpis .card { margin-top: 0; }
.card__head { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.card__head h2, .card__head h3 { font-size: 15.5px; }
.card__head .spacer { flex: 1; }
.card__body { padding: 20px; }
.card__body.tight { padding: 14px 20px; }
.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: 600 14px/1 var(--font-display); cursor: pointer; text-decoration: none; transition: transform .12s, background .15s, border-color .15s; }
.btn:hover { transform: translateY(-1px); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--lime); border-color: transparent; color: #16220b; }
.btn-primary:hover { background: #c8ff63; }
.btn-dark { background: var(--sel-bg); border-color: transparent; color: var(--sel-fg); }
.btn-ghost { background: transparent; }
.btn-danger { color: var(--danger); border-color: rgba(192,57,43,.3); background: var(--danger-soft); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 7px; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

label.field { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
label.field > .hint, div.field > .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  font: 400 14px/1.5 var(--font-body); color: var(--ink); }
textarea { resize: vertical; min-height: 84px; }
textarea.rich { font-family: var(--font-body); }
textarea.code { font-family: var(--font-mono); font-size: 12.5px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
input[type=color] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 500; color: var(--ink); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--lime-ink); }
fieldset { border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; }
legend { padding: 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font: 600 11.5px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.badge.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.badge.warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-bd); }
.badge.off { background: var(--surface-2); }
.badge.role { text-transform: none; font-family: var(--font-body); letter-spacing: 0; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 11.5px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); padding: 0 14px 8px; }
td { padding: 12px 14px; border-top: 1px solid var(--border); vertical-align: middle; }
tr:hover td { background: var(--hover); }

.flash { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border-radius: var(--r); margin-bottom: 18px; font-size: 14px; border: 1px solid; }
.flash.ok { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.flash.err { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-fg); }
.flash.info { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }

.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty h3 { margin-bottom: 6px; }

/* ---------------- login ---------------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth__art { background: var(--navy); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth__art h2 { color: #fff; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.02em; max-width: 15em; }
.auth__art .lime { color: var(--lime); }
.auth__art p { color: rgba(231,236,244,.7); max-width: 34em; margin-top: 14px; }
.auth__art .glow { position: absolute; width: 620px; height: 620px; right: -220px; bottom: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(184,255,61,.16), transparent 62%); }
.auth__form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth__form .box { width: 100%; max-width: 390px; }
.auth__form h1 { font-size: 25px; letter-spacing: -.02em; margin-bottom: 6px; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth__art { display: none; } }

/* ---------------- editor ---------------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 42%); gap: 20px; align-items: start; }
@media (max-width: 1100px) { .editor { grid-template-columns: 1fr; } }
.preview { position: sticky; top: 84px; }
.preview__frame { width: 100%; aspect-ratio: 10 / 14; border: 1px solid var(--border); border-radius: var(--r-lg); background: #fff; box-shadow: var(--shadow); }
.preview__bar { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }

.sections { display: grid; gap: 10px; }
.sec { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-sm); display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.sec.off { background: var(--surface-2); opacity: .72; }
.sec__ico { width: 34px; height: 34px; flex: none; border-radius: 9px; background: var(--lime-soft); display: grid; place-items: center; }
.sec__ico svg { width: 18px; height: 18px; fill: none; stroke: var(--lime-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sec__txt { min-width: 0; flex: 1; }
.sec__txt strong { font-family: var(--font-display); font-size: 14.5px; color: var(--ink); }
.sec__txt p { font-size: 12.8px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec__acts { display: flex; gap: 6px; align-items: center; }
.sec form { display: inline; }

.listitem { border: 1px solid var(--border); border-radius: var(--r); padding: 14px; background: var(--surface-2); display: grid; gap: 12px; position: relative; }
.listitem + .listitem { margin-top: 10px; }
.listitem__head { display: flex; align-items: center; gap: 8px; }
.listitem__head strong { font-family: var(--font-mono); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); flex: 1; }
.listitem.removed { display: none; }
.imgpick { display: grid; gap: 8px; border: 1px dashed var(--border-strong); border-radius: var(--r); padding: 12px; background: var(--surface-2); }
.imgpick__row { display: flex; gap: 12px; align-items: center; }
.imgpick__thumb { width: 74px; height: 56px; flex: none; border-radius: 8px; border: 1px solid var(--border); background: #fff center/contain no-repeat; }
.imgpick__meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; flex: 1; }
.toolbar { display: flex; gap: 6px; margin-bottom: -2px; }
.toolbar button { font: 600 11.5px/1 var(--font-mono); padding: 5px 9px; border-radius: 7px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; color: var(--muted); }
.toolbar button:hover { color: var(--ink); border-color: var(--border-strong); }

.medialib { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.mediacard { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.mediacard__img { height: 116px; background: var(--surface-2) center/contain no-repeat; display: block; }
.mediacard__meta { padding: 9px 11px; font-size: 12px; color: var(--muted); display: grid; gap: 4px; }
.mediacard__meta b { color: var(--ink); font-weight: 600; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* margin:auto é o que centra um <dialog> modal — o reset global (* { margin:0 }) zerava isso */
dialog { border: 0; border-radius: var(--r-lg); padding: 0; box-shadow: var(--shadow); max-width: 860px;
  width: calc(100% - 40px); background: var(--surface); margin: auto; }
dialog::backdrop { background: rgba(10,22,40,.5); backdrop-filter: blur(3px); }
dialog::backdrop { background: rgba(10,22,40,.5); backdrop-filter: blur(3px); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(180deg, rgba(250,250,247,0), var(--bg) 40%); padding: 16px 0 4px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
/* padrão de cadastro: mudar status e apagar ficam no fim da barra de ações, à direita */
.sticky-actions__situacao { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sticky-actions__situacao .dica { font-size: 12px; color: var(--muted); }
/* modal de apagar: confirma digitando o nome */
.modal-apagar { max-width: 460px; width: calc(100% - 32px); background: var(--surface); color: var(--ink-body); }
.modal-apagar .card__head h3 { color: var(--danger); }
.modal-apagar .card__body p { color: var(--ink-body); }
.modal-apagar input[aria-invalid=true] { border-color: var(--danger); }
.modal-apagar__pe { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--border);
  background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg); }

.kpi { display: grid; gap: 4px; }
.kpi b { font-family: var(--font-display); font-size: 27px; color: var(--ink); letter-spacing: -.02em; }
.kpi span { font: 600 11.5px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }

.tpl-card { border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--surface); display: grid; }
.tpl-card__top { height: 96px; background: linear-gradient(135deg, var(--navy), #16304f); position: relative; }
.tpl-card__top::after { content: ""; position: absolute; inset: 0; background: radial-gradient(240px 120px at 80% 120%, rgba(184,255,61,.35), transparent 60%); }
.tpl-card__body { padding: 16px 18px; display: grid; gap: 8px; }

@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .side__group, .side__label, .side__foot { display: none; }
  .side__brand { margin-right: auto; }
  .side .mobile { display: flex; }
  .content { padding: 18px; }
}
.mobile { display: none; }


/* =================================================================
   PADRÃO DE CADASTRO
   Estrutura: .cad-head (título + ação) · .cad-kpis · .cad-toolbar
   (busca + filtros) · .card com .tbl (tabela de largura total).
   Toda tela de cadastro usa `wide: true` no partial top.
   ================================================================= */
.cad-head { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.cad-head__txt { flex: 1; min-width: 220px; }
.cad-head h2 { font-size: 17px; letter-spacing: -.01em; }
.cad-head p { color: var(--muted); font-size: 13px; margin-top: 2px; }

/* resumo do cabeçalho: ocupa a largura toda e todas as caixas ficam do MESMO tamanho
   (colunas de fração igual + altura mínima comum) */
.cad-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: stretch; gap: 12px; margin-bottom: 16px; }
@media (max-width: 560px) { .cad-kpis { grid-template-columns: repeat(2, 1fr); } }
/* todas as caixas com a MESMA altura: o cartão estica na linha e o corpo ocupa tudo */
.cad-kpis .card { display: flex; height: 100%; margin-top: 0; }
.cad-kpis .card__body { padding: 14px 16px; display: flex; align-items: center; width: 100%; min-height: 86px; }
.cad-kpis .kpi { gap: 2px; }
.cad-kpis .kpi b { font-size: 23px; line-height: 1.1; }
.cad-kpis .kpi span { line-height: 1.35; }

.cad-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
/* busca ocupa o espaço livre à esquerda; todo o resto vai para a direita */
/* a busca ocupa todo o espaço que sobra; o botão fica no fim dela, à direita */
.cad-toolbar form.busca { display: flex; gap: 8px; align-items: center; flex: 1 1 320px; min-width: 280px; }
.cad-toolbar form.busca input[type=search] { flex: 1 1 auto; min-width: 0; }
.cad-toolbar form.busca .btn { flex: none; }
.cad-toolbar__dir { margin-left: auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.cad-toolbar input[type=search] { padding: 12px 18px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 400 15px/1.4 var(--font-body); width: 100%; }
.cad-toolbar input[type=search]::placeholder { color: var(--muted); }
.cad-toolbar input[type=search]:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted);
  font: 600 12.5px/1 var(--font-display); text-decoration: none; white-space: nowrap; }
.chip:hover { color: var(--ink); }
.chip.on { background: var(--sel-bg); border-color: transparent; color: var(--sel-fg); }
.chip span { font-family: var(--font-mono); font-size: 11px; opacity: .75; }

/* tabela de cadastro: largura total, cabeçalho fixo ao rolar */
.tbl { overflow-x: auto; }
.tbl table { min-width: 720px; }
.tbl thead th { position: sticky; top: 0; z-index: 2; background: var(--surface);
  box-shadow: inset 0 -1px 0 var(--border); padding: 12px 16px; }
.tbl td { padding: 13px 16px; }
.tbl tbody tr:nth-child(even) td { background: var(--zebra); }
.tbl tbody tr:hover td { background: var(--lime-soft); }
.tbl td.acoes { text-align: right; white-space: nowrap; }
.tbl .principal { font-family: var(--font-display); font-weight: 600; color: var(--ink); text-decoration: none; }
.tbl .principal:hover { text-decoration: underline; }
.tbl tr.inativa td { color: var(--muted); }
.tbl tr.inativa .principal { color: var(--muted); }

/* formulário de cadastro em grade */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
/* formato antigo de vínculo (fora do padrão de seções): mantido para telas que ainda o usem */
.form-vinculo:not(.form-secao) { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px;
  padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px dashed var(--border-strong); }

/* ===== PADRÃO DE CADASTRO — formulário em seções e grade de 12 colunas =====
   .form-secao (Vínculo / Dados) > .g12 > .field.cN — N = largura do campo (col no catálogo de telas.js) */
.form-secao + .form-secao { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.form-secao__titulo { display: block; margin-bottom: 14px; font: 600 10.5px/1.4 var(--font-mono);
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.g12, .form-grid.g12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 18px; align-items: start; }
.g12 > .c2 { grid-column: span 2; } .g12 > .c3 { grid-column: span 3; } .g12 > .c4 { grid-column: span 4; }
.g12 > .c5 { grid-column: span 5; } .g12 > .c6 { grid-column: span 6; } .g12 > .c7 { grid-column: span 7; }
.g12 > .c8 { grid-column: span 8; } .g12 > .c9 { grid-column: span 9; } .g12 > .c10 { grid-column: span 10; }
.g12 > .c12 { grid-column: span 12; }
@media (max-width: 900px) {
  .g12 > .c2, .g12 > .c3, .g12 > .c4, .g12 > .c5 { grid-column: span 6; }
  .g12 > .c6, .g12 > .c7, .g12 > .c8, .g12 > .c9, .g12 > .c10 { grid-column: span 12; }
}
@media (max-width: 560px) { .g12 > * { grid-column: 1 / -1 !important; } }
/* dado somente leitura ao lado de um campo (ex.: e-mail e papel que vêm do usuário) */
.info-lida { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.info-lida__valor { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 44px; padding: 8px 12px;
  border-radius: 10px; border: 1px dashed var(--border-strong); background: var(--surface-2); font-weight: 400; color: var(--ink-body); }
/* datas do registro no cabeçalho do cartão (parcial cad-registro) */
.cad-meta { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: -2px; font-size: 12.5px; color: var(--muted); }
.cad-meta span { display: inline-flex; align-items: center; gap: 6px; }
.cad-meta b { font-weight: 600; color: var(--ink-body); }
.cad-meta svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .75; }

/* ===== NÍVEIS por dispositivos ativos — selo, quadro da ficha e formulário ===== */
.nivel-selo { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px 2px 7px; border-radius: 999px; white-space: nowrap;
  font: 600 12px/1.6 var(--font-display); color: var(--ink);
  background: color-mix(in srgb, var(--nivel) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--nivel) 45%, transparent); }
.nivel-selo i { width: 9px; height: 9px; border-radius: 50%; background: var(--nivel); flex: none; }
.nivel-ficha { box-shadow: inset 4px 0 0 var(--nivel); }
.nivel-resumo { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(240px, 1.4fr) minmax(220px, 1.2fr); margin-bottom: 16px; overflow: hidden; }
.card.nivel-resumo + .card, .card.nivel-resumo + form .card { margin-top: 0; }
.nivel-resumo > div { padding: 16px 20px; display: grid; gap: 5px; align-content: start; }
.nivel-resumo > div + div { border-left: 1px solid var(--border); }
.nivel-resumo__rotulo { font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.nivel-resumo__atual { background: color-mix(in srgb, var(--nivel) 12%, var(--surface)); box-shadow: inset 4px 0 0 var(--nivel); }
.nivel-resumo__atual > b { font: 700 22px/1.2 var(--font-display); color: var(--ink); letter-spacing: -.01em; }
.nivel-resumo__prox { font-family: var(--font-display); color: var(--ink); }
.nivel-resumo ul { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.nivel-resumo li { padding: 3px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 13px; }
.nivel-resumo li b { color: var(--ink); }
.nivel-barra { height: 6px; margin-top: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.nivel-barra i { display: block; height: 100%; border-radius: 999px; background: var(--nivel-prox, var(--lime-ink)); }
.nivel-resumo > .nivel-resumo__links { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 16px; padding: 10px 20px;
  border-left: 0; border-top: 1px solid var(--border); font-size: 12.5px; }
@media (max-width: 860px) {
  .nivel-resumo { grid-template-columns: 1fr; }
  .nivel-resumo > div + div { border-left: 0; border-top: 1px solid var(--border); }
}
.beneficios { display: grid; gap: 10px; }
.beneficio { display: grid; grid-template-columns: minmax(0, 1fr) 170px auto; gap: 10px; align-items: end; }
@media (max-width: 560px) { .beneficio { grid-template-columns: minmax(0, 1fr) 110px auto; } }
.cores { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.cor { position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 6px 12px 6px 8px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--ink); }
.cor i { width: 14px; height: 14px; border-radius: 50%; background: var(--nivel); }
.cor input { position: absolute; opacity: 0; pointer-events: none; }
.cor:has(input:checked) { border-color: var(--nivel); background: color-mix(in srgb, var(--nivel) 14%, var(--surface));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--nivel) 35%, transparent); }
.cor:has(input:focus-visible) { outline: 2px solid var(--lime); outline-offset: 2px; }
.form-grid .wide2 { grid-column: span 2; }
@media (max-width: 640px) { .form-grid .wide2 { grid-column: auto; } }
details.painel { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow: hidden; }
details.painel > summary { cursor: pointer; list-style: none; padding: 14px 20px; font: 600 14.5px/1 var(--font-display);
  color: var(--ink); display: flex; align-items: center; gap: 10px; }
details.painel > summary::-webkit-details-marker { display: none; }
details.painel > summary::before { content: "+"; width: 20px; height: 20px; border-radius: 6px; background: var(--lime);
  color: #16220b; display: grid; place-items: center; font-size: 15px; line-height: 1; }
details.painel[open] > summary::before { content: "–"; }
details.painel[open] > summary { border-bottom: 1px solid var(--border); }
details.painel .corpo { padding: 18px 20px; }

/* =================================================================
   USUÁRIO NO TOPO À DIREITA
   ================================================================= */
.user-btn { display: flex; align-items: center; gap: 9px; background: none; border: 1px solid transparent;
  border-radius: 999px; padding: 4px 10px 4px 4px; cursor: pointer; font-family: inherit; color: inherit; }
.user-btn:hover { background: var(--surface-2); border-color: var(--border); }
.user-btn[aria-expanded=true] { background: var(--surface-2); border-color: var(--border-strong); }
.user-btn__av { width: 32px; height: 32px; border-radius: 50%; background: var(--sel-bg); color: var(--sel-fg);
  display: grid; place-items: center; font: 700 12px/1 var(--font-display); flex: none; }
.user-btn__txt { line-height: 1.2; text-align: left; }
.user-btn__txt b { display: block; font-size: 13px; font-weight: 600; color: var(--ink); }
.user-btn__txt small { display: block; font-size: 11px; color: var(--muted); }
.user-btn__av--foto { object-fit: cover; padding: 0; }
.user-menu__topo .user-btn__av--foto { width: 42px; height: 42px; }
.user-btn__seta { color: var(--muted); font-size: 11px; }
@media (max-width: 720px) { .user-btn__txt { display: none; } }

.user-menu { position: absolute; top: 58px; right: 22px; width: 290px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); z-index: 60; overflow: hidden; }
.user-menu__topo { display: flex; gap: 11px; padding: 15px 16px; border-bottom: 1px solid var(--border); }
.user-menu__topo .user-btn__av { width: 42px; height: 42px; font-size: 14px; }
.user-menu__topo b { display: block; font-size: 13.5px; color: var(--ink); }
.user-menu__topo .mail { font-size: 12px; color: var(--muted); word-break: break-all; }
.user-menu__ctx { padding: 8px 16px; background: var(--surface-2); border-bottom: 1px solid var(--border);
  font: 600 11px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.user-menu__itens { display: flex; flex-direction: column; padding: 6px; }
.user-menu__itens a, .user-menu__itens button { display: flex; align-items: center; gap: 9px; width: 100%;
  text-align: left; padding: 9px 11px; border: 0; background: none; border-radius: 9px;
  font: 500 13.5px/1.2 var(--font-body); color: var(--ink); cursor: pointer; text-decoration: none; }
.user-menu__itens a:hover, .user-menu__itens button:hover { background: var(--surface-2); }
.user-menu__itens svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.user-menu__itens .perigo { color: var(--danger); }
.user-menu__itens .perigo:hover { background: var(--danger-soft); }
/* fuso em que os horários estão sendo mostrados (gravação é sempre UTC) */
.user-menu__fuso { display: flex; align-items: center; gap: 7px; padding: 8px 16px; border-bottom: 1px solid var(--border);
  font-size: 12px; color: var(--muted); }
.user-menu__fuso svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round; }

/* ---- alternador lista/fichas ---- */
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
/* só ícone: alvo de clique quadrado e confortável */
.seg__btn { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 38px;
  text-decoration: none; color: var(--muted); }
.seg__btn + .seg__btn { border-left: 1px solid var(--border); }
.seg__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.seg__btn:hover { color: var(--ink); background: var(--surface-2); }
.seg__btn.on { background: var(--sel-bg); color: var(--sel-fg); border-color: transparent; }

/* ---- modo fichas: um cartão por registro ---- */
/* fichas todas com a MESMA largura: coluna de tamanho fixo, alinhadas à esquerda.
   Em telas estreitas, a coluna passa a ocupar a linha inteira. */
.cad-fichas { display: grid; grid-template-columns: repeat(auto-fill, 320px); justify-content: start;
  align-items: stretch; gap: 14px; }
@media (max-width: 700px) { .cad-fichas { grid-template-columns: 1fr; } }
.ficha { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column; min-height: 230px;
  transition: transform .12s, box-shadow .15s; }
.ficha:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.ficha.inativa { background: var(--surface-2); }
.ficha.inativa .ficha__nome { color: var(--muted); }
.ficha__topo { padding: 15px 17px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: flex-start; gap: 10px; }
.ficha__nome { font-family: var(--font-display); font-weight: 650; font-size: 15.5px; color: var(--ink);
  text-decoration: none; letter-spacing: -.01em; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ficha__nome:hover { text-decoration: underline; }
.ficha__corpo { padding: 14px 17px; display: grid; gap: 11px; flex: 1; align-content: start; }
.ficha__linha { display: grid; gap: 2px; }
.ficha__linha label { font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.ficha__linha div { font-size: 13.8px; color: var(--ink); }
.ficha__pe { padding: 11px 17px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ficha__pe .badge { flex: none; }
.ficha__pe .muted { flex: 1; font-size: 12px; }
.ficha__pe form { display: inline; }
/* blocos de dados fora da ficha (ex.: resumo da conta) */
.dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px 18px; }


/* ---- paginação do padrão de cadastro ---- */
.pag { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--border); }
.pag--solta { border-top: 0; padding: 16px 0 0; }
.pag__info { color: var(--muted); font-size: 13px; flex: 1; }
.pag__nums { display: flex; gap: 4px; align-items: center; }
.pag__btn { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 9px;
  border: 1px solid var(--border-strong); border-radius: 9px; background: var(--surface); color: var(--ink);
  font: 600 13px/1 var(--font-display); text-decoration: none; }
.pag__btn:hover { background: var(--surface-2); }
.pag__btn.on { background: var(--sel-bg); border-color: transparent; color: var(--sel-fg); }
.pag__btn.off { opacity: .4; pointer-events: none; }
.pag__reticencia { color: var(--muted); padding: 0 2px; }

/* ---- abas das telas de edição ---- */
.abas { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.abas__item { display: inline-flex; align-items: center; gap: 7px; padding: 11px 16px; text-decoration: none;
  color: var(--muted); font: 600 14px/1 var(--font-display); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.abas__item:hover { color: var(--ink); background: var(--surface-2); border-radius: 8px 8px 0 0; }
.abas__item.on { color: var(--ink); border-bottom-color: var(--lime-ink); }
.abas__item span { font: 600 11px/1.5 var(--font-mono); padding: 1px 7px; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.abas__item.on span { background: var(--lime-soft); color: var(--lime-ink); border-color: rgba(95,140,20,.28); }


/* =================================================================
   TEMA ESCURO
   data-tema="escuro" força; sem atributo ou "auto" segue o sistema.
   Hierarquia de fundos: menu (mais escuro) < tela < cartões (mais claros),
   para que a lateral se diferencie do conteúdo.
   ================================================================= */
:root[data-tema="escuro"] {
  --bg: #101926; --bg-2: #0c1420; --surface: #18222f; --surface-2: #1f2a39;
    --side-bg: #080f19;                 /* menu mais escuro que a tela, para diferenciar */
    --ink: #eef3fa; --ink-body: #c5d0e0; --muted: #8d99ab; --navy: #080f19;
    --lime: #B8FF3D; --lime-ink: #cbff70; --lime-soft: rgba(184,255,61,.14);
    --border: rgba(255,255,255,.10); --border-strong: rgba(255,255,255,.19);
    --danger: #ff7a6e; --danger-soft: rgba(255,122,110,.12); --ok: #5fd98f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 10px 24px -18px rgba(0,0,0,.6);
    --shadow: 0 2px 10px rgba(0,0,0,.45), 0 30px 60px -32px rgba(0,0,0,.7);
    --bar-bg: rgba(16,25,38,.92);
    --zebra: rgba(255,255,255,.025); --hover: rgba(255,255,255,.045);
    --sel-bg: var(--lime); --sel-fg: #16220b;
    --ok-bg: rgba(95,217,143,.16); --ok-bd: rgba(95,217,143,.32); --ok-fg: #9ff0bd;
    --err-bg: rgba(255,122,110,.14); --err-bd: rgba(255,122,110,.34); --err-fg: #ffb3aa;
    --info-bg: rgba(120,170,255,.12); --info-bd: rgba(120,170,255,.3); --info-fg: #b8d0ff;
    --warn-bg: rgba(255,190,80,.14); --warn-bd: rgba(255,190,80,.32); --warn-fg: #ffd79a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]):not([data-tema="escuro"]) {
  --bg: #101926; --bg-2: #0c1420; --surface: #18222f; --surface-2: #1f2a39;
    --side-bg: #080f19;                 /* menu mais escuro que a tela, para diferenciar */
    --ink: #eef3fa; --ink-body: #c5d0e0; --muted: #8d99ab; --navy: #080f19;
    --lime: #B8FF3D; --lime-ink: #cbff70; --lime-soft: rgba(184,255,61,.14);
    --border: rgba(255,255,255,.10); --border-strong: rgba(255,255,255,.19);
    --danger: #ff7a6e; --danger-soft: rgba(255,122,110,.12); --ok: #5fd98f;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.4), 0 10px 24px -18px rgba(0,0,0,.6);
    --shadow: 0 2px 10px rgba(0,0,0,.45), 0 30px 60px -32px rgba(0,0,0,.7);
    --bar-bg: rgba(16,25,38,.92);
    --zebra: rgba(255,255,255,.025); --hover: rgba(255,255,255,.045);
    --sel-bg: var(--lime); --sel-fg: #16220b;
    --ok-bg: rgba(95,217,143,.16); --ok-bd: rgba(95,217,143,.32); --ok-fg: #9ff0bd;
    --err-bg: rgba(255,122,110,.14); --err-bd: rgba(255,122,110,.34); --err-fg: #ffb3aa;
    --info-bg: rgba(120,170,255,.12); --info-bd: rgba(120,170,255,.3); --info-fg: #b8d0ff;
    --warn-bg: rgba(255,190,80,.14); --warn-bd: rgba(255,190,80,.32); --warn-fg: #ffd79a;
  }
}
/* separação extra entre menu e conteúdo no escuro */
:root[data-tema="escuro"] .side { border-right: 1px solid rgba(255,255,255,.07); }
:root[data-tema="escuro"] .topbar { border-bottom-color: rgba(255,255,255,.09); }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .side { border-right: 1px solid rgba(255,255,255,.07); }
  :root:not([data-tema="claro"]) .topbar { border-bottom-color: rgba(255,255,255,.09); }
}
/* no escuro o botão primário mantém o lime; o texto escuro garante contraste */
:root[data-tema="escuro"] .btn-primary, :root:not([data-tema="claro"]) .btn-primary { color: #16220b; }

/* ---- seletor de tema no topo ---- */
.tema { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 999px; overflow: hidden; background: var(--surface); }
.tema__btn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 34px;
  color: var(--muted); text-decoration: none; }
.tema__btn + .tema__btn { border-left: 1px solid var(--border); }
.tema__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tema__btn:hover { color: var(--ink); background: var(--surface-2); }
.tema__btn.on { background: var(--sel-bg); color: var(--sel-fg); }
@media (max-width: 560px) { .tema { display: none; } }

/* ---- opções em cartão (radio), ex.: estrutura do parceiro ---- */
.opcoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-top: 4px; }
.opcao { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--r); background: var(--surface); cursor: pointer; }
.opcao:hover { background: var(--surface-2); }
.opcao input { margin-top: 2px; width: 17px; height: 17px; accent-color: var(--lime-ink); flex: none; }
.opcao span { display: grid; gap: 2px; }
.opcao b { font: 600 14px/1.3 var(--font-display); color: var(--ink); }
.opcao small { color: var(--muted); font-size: 12.5px; }
.opcao:has(input:checked) { border-color: var(--lime-ink); background: var(--lime-soft); }

/* =================================================================
   ABRANGÊNCIA — seletor no menu lateral (conta mestre → regional →
   franquia → carteira → parceiro) e a matriz de menus por nível.
   O menu lateral é escuro nos dois temas, então o seletor usa as
   mesmas transparências sobre branco que o .side.
   ================================================================= */
.abr__atual { list-style: none; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 10px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); color: #fff; cursor: pointer; user-select: none; }
.abr__atual::-webkit-details-marker { display: none; }
.abr__atual::marker { content: ""; }
.abr__atual:hover { background: rgba(255,255,255,.1); }
.abr__atual:focus-visible { outline: 2px solid var(--lime); outline-offset: 1px; }
.abr[open] > .abr__atual { border-color: rgba(184,255,61,.55); }
.abr__atual svg, .abr__no svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.abr__atual svg { width: 18px; height: 18px; color: var(--lime); }
.abr__txt { display: grid; min-width: 0; flex: 1; line-height: 1.2; }
/* nome em cima, com o destaque; o tipo do nível embaixo, discreto */
.abr__txt b { font-size: 14.5px; line-height: 1.25; font-weight: 600; letter-spacing: -.005em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abr__txt small { margin-top: 1px; font: 600 9.5px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .11em; color: rgba(231,236,244,.5); }
.abr__seta { color: rgba(231,236,244,.55); font-size: 11px; transition: transform .15s; }
.abr[open] .abr__seta { transform: rotate(180deg); }
.abr__painel { margin-top: 6px; padding: 6px; border-radius: 10px; background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.08); display: grid; gap: 6px; }
.abr__busca { width: 100%; padding: 7px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05); color: #fff; font: inherit; font-size: 13px; }
.abr__busca::placeholder { color: rgba(231,236,244,.45); }
.abr__busca:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.abr__lista { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow-y: auto; display: grid; gap: 1px; }
.abr__lista li.oculto { display: none; }
.abr__no { position: relative; display: flex; align-items: center; gap: 8px; border-radius: 7px; text-decoration: none;
  padding: 6px 8px 6px calc(8px + var(--prof, 0) * 14px); color: rgba(231,236,244,.82); font-size: 13px; }
.abr__no:hover { background: rgba(255,255,255,.07); color: #fff; }
.abr__no.on { background: rgba(184,255,61,.14); color: #fff; box-shadow: inset 2px 0 0 var(--lime); }
.abr__no svg { width: 15px; height: 15px; opacity: .75; }
.abr__no span { display: grid; min-width: 0; line-height: 1.25; }
.abr__no b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abr__no small { font-size: 10.5px; color: rgba(231,236,244,.45); }
/* agrupadores "Sem regional" / "Sem carteira" */
.abr__no--sem b { font-style: italic; color: rgba(231,236,244,.68); }
.abr__no--sem:hover b, .abr__no--sem.on b { color: #fff; }
.abr__no--sem svg { opacity: .55; }
/* traço de ligação com o nível de cima */
.abr__lista li + li .abr__no::before { content: ""; position: absolute; top: 50%; width: 7px;
  left: calc(var(--prof, 0) * 14px - 3px); border-top: 1px solid rgba(255,255,255,.2); }
.abr__vazio { padding: 4px 8px; font-size: 12.5px; color: rgba(231,236,244,.55); }
.abr__contas { border-top: 1px solid rgba(255,255,255,.08); padding: 8px 2px 2px; display: grid; gap: 6px; }
.abr__contas span { font: 600 9.5px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .11em; color: rgba(231,236,244,.5); }
@media (max-width: 860px) { .abr { order: 3; flex-basis: 100%; } }

/* Plataforma → Abrangência */
.abr-niveis { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.abr-nivel { display: flex; gap: 11px; align-items: center; padding: 12px 14px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); min-width: 0; }
.abr-nivel.on { border-color: var(--lime-ink); background: var(--lime-soft); }
.abr-nivel svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--lime-ink); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; }
.abr-nivel__txt { display: grid; min-width: 0; line-height: 1.3; }
.abr-nivel__txt small { font: 600 10.5px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.abr-nivel__txt b { font-family: var(--font-display); font-size: 14.5px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abr-nivel__txt > span { font-size: 12.5px; color: var(--muted); }
.abr-matriz table { min-width: 680px; }
.abr-matriz th.abr-matriz__col, .abr-matriz td.abr-matriz__cel { text-align: center; width: 14%; }
.abr-matriz__todos { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; white-space: nowrap; }
.abr-matriz input[type=checkbox] { width: 17px; height: 17px; accent-color: var(--lime-ink); cursor: pointer; vertical-align: middle; }
.abr-matriz input[type=checkbox]:disabled { cursor: not-allowed; opacity: .55; }
.tbl tbody tr.abr-matriz__grupo td { font: 600 10.5px/1.5 var(--font-mono); text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); background: var(--surface-2); padding: 8px 16px; }
.abr-matriz__item { display: inline-flex; align-items: center; gap: 9px; font-weight: 500; color: var(--ink); }
.abr-matriz__item svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; opacity: .7; }

/* =================================================================
   TELAS — ordem e obrigatoriedade dos campos dos cadastros
   ================================================================= */
.telas { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, 1fr); gap: 16px; align-items: start; }
.telas__col { display: grid; gap: 16px; min-width: 0; }
@media (max-width: 1000px) { .telas { grid-template-columns: 1fr; } }
.campos { list-style: none; margin: 0; padding: 8px; display: grid; gap: 5px; }
.campo { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 9px 10px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.campo[draggable=true] { cursor: grab; }
.campo.arrastando { opacity: .45; }
.campo.acima { box-shadow: inset 0 3px 0 var(--lime-ink); }
.campo.abaixo { box-shadow: inset 0 -3px 0 var(--lime-ink); }
.campo--fixo { background: var(--surface-2); }
.campo__pega { color: var(--muted); letter-spacing: -2px; font-size: 13px; width: 14px; text-align: center; }
.campo__n { font: 600 11px/1 var(--font-mono); color: var(--muted); min-width: 16px; text-align: right; }
.campo__nome { flex: 1; min-width: 140px; display: grid; line-height: 1.3; }
.campo__nome b { font-weight: 600; color: var(--ink); font-size: 14px; }
.campo__nome small { color: var(--muted); font-size: 11.5px; }
.campo__setas { display: inline-flex; gap: 2px; }
.campo__setas .btn { padding: 4px 10px; }
.campo__setas .btn:disabled { opacity: .3; cursor: default; }
.campo__obrig { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px;
  border: 1px solid var(--border-strong); font-size: 13px; font-weight: 500; color: var(--ink); cursor: pointer; }
.campo__obrig input { width: 16px; height: 16px; accent-color: var(--lime-ink); }
.campo__obrig:has(input:checked) { background: var(--lime-soft); border-color: var(--lime-ink); }
.previa { padding: 16px 18px; display: grid; gap: 12px; }
.previa__vinc { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; padding-bottom: 12px; border-bottom: 1px dashed var(--border-strong); }
.previa__grade { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 10px; }
.previa__campo { display: grid; gap: 5px; min-width: 0; }
.previa__campo span { font-size: 12px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.previa__campo.obrig span::after { content: " *"; color: var(--danger); }
.previa__campo i { display: block; height: 30px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface-2); }
/* onde cada campo aparece: Lista, Ficha e Edição */
.vistas { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.vista { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; user-select: none;
  border: 1px solid var(--border-strong); font-size: 12px; font-weight: 500; color: var(--ink); cursor: pointer; }
.vista input { width: 14px; height: 14px; margin: 0; accent-color: var(--lime-ink); }
.vista:has(input:checked) { background: var(--lime-soft); border-color: var(--lime-ink); }
.vista.trava { cursor: default; opacity: .7; }
.vista.na { color: var(--muted); border-style: dashed; cursor: default; opacity: .6; }
.campo__obrig:has(input:disabled) { opacity: .55; cursor: default; }
.campo--oculto .campo__nome b { color: var(--muted); }
.campo--exibe { background: var(--surface-2); }
.previa [hidden] { display: none !important; }
.previa + .previa { border-top: 1px solid var(--border); }
.previa__titulo { font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.previa__cols { display: flex; flex-wrap: wrap; gap: 6px; }
.previa__col { font-size: 12px; font-weight: 500; padding: 5px 9px; border: 1px solid var(--border-strong); border-radius: 6px;
  background: var(--surface-2); color: var(--ink); }
.previa__col.principal { font-weight: 650; }
.previa__col.acao { border-style: dashed; color: var(--muted); }
.previa__ficha { max-width: 320px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); display: grid; }
.previa__ficha-topo { padding: 10px 13px; border-bottom: 1px solid var(--border); font-weight: 650; font-size: 13.5px; color: var(--ink); }
.previa__ficha-corpo { padding: 10px 13px; display: grid; gap: 9px; }
.previa__linha { display: grid; gap: 4px; }
.previa__linha span { font: 600 10px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.previa__linha i { display: block; height: 7px; width: 70%; border-radius: 4px; background: var(--border-strong); }

/* ---- tela Arrumar menu (arrastar e soltar) ---- */
/* grupos empilhados, um abaixo do outro (facilita arrastar entre eles) */
/* grupos empilhados, um abaixo do outro, ocupando toda a largura da página */
.arrumar { display: grid; grid-template-columns: 1fr; gap: 14px; align-items: start; }
.arrumar__itens { grid-template-columns: 1fr; }
.arrumar__grupo { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); padding: 6px; }
.arrumar__grupo.arrastando { opacity: .5; }
.arrumar__grupo.alvo { outline: 2px dashed var(--lime-ink); outline-offset: 2px; }
.arrumar__cab { display: flex; align-items: center; gap: 9px; padding: 10px 12px; cursor: grab; }
.arrumar__cab b { font: 650 14px/1 var(--font-display); color: var(--ink); flex: 1; }
.arrumar__conta { font-family: var(--font-mono); }
.arrumar__pega { color: var(--muted); font-size: 12px; letter-spacing: -2px; cursor: grab; user-select: none; }
.arrumar__itens { list-style: none; display: grid; gap: 6px; padding: 0 6px 6px; margin: 0; min-height: 12px; }
.arrumar__item { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid var(--border);
  border-radius: 10px; background: var(--surface-2); cursor: grab; }
.arrumar__item:hover { border-color: var(--border-strong); }
.arrumar__item.arrastando { opacity: .45; }
.arrumar__item.acima { box-shadow: inset 0 2px 0 var(--lime-ink); }
.arrumar__item.abaixo { box-shadow: inset 0 -2px 0 var(--lime-ink); }
.arrumar__ico { width: 17px; height: 17px; fill: none; stroke: var(--lime-ink); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.arrumar__nome { font-size: 14px; color: var(--ink); font-weight: 500; flex: 1; }
.arrumar__cab .arrumar__nome { flex: 1; font: 650 14px/1 var(--font-display); }
.arrumar__lapis { border: 0; background: none; padding: 3px; border-radius: 7px; cursor: pointer; color: var(--muted);
  display: grid; place-items: center; flex: none; }
.arrumar__lapis:hover { background: var(--surface); color: var(--ink); }
.arrumar__lapis svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.arrumar__edicao { flex: 1; min-width: 0; padding: 5px 9px; border: 1px solid var(--lime-ink); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: 500 14px/1.2 var(--font-body); }
.arrumar__edicao:focus { outline: 2px solid var(--lime); outline-offset: 1px; }
.arrumar__vazio { padding: 10px 12px; border: 1px dashed var(--border-strong); border-radius: 10px; margin: 0 6px 6px; }

/* ---- tema: bolinha única com menu ---- */
.tema-bola { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0; }
.tema-bola:hover, .tema-bola[aria-expanded=true] { background: var(--surface-2); color: var(--ink); }
.tema-bola svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tema-menu { position: absolute; top: 58px; right: 22px; width: 216px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); z-index: 60; overflow: hidden; padding: 6px; }
.tema-menu__titulo { font: 600 11px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); padding: 6px 10px; }
.tema-menu a { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 9px;
  text-decoration: none; color: var(--ink); font: 500 13.5px/1.2 var(--font-body); }
.tema-menu a:hover { background: var(--surface-2); }
.tema-menu a.on { background: var(--lime-soft); color: var(--lime-ink); font-weight: 600; }
.tema-menu svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* ---- avisos flutuantes ---- */
#toast-root { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--navy); color: #fff; padding: 11px 16px; border-radius: 10px; font-size: 13.5px;
  box-shadow: var(--shadow); max-width: 340px; }
.toast.ok { background: var(--lime); color: #16220b; font-weight: 600; }
.toast.erro { background: var(--danger); color: #fff; }

/* ---- Meu perfil: capa com foto ---- */
.perfil-capa { position: relative; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-sm); overflow: hidden; margin-bottom: 18px; }
.perfil-capa__fundo { height: 88px; background: linear-gradient(135deg, var(--navy), #16304f 60%, var(--lime-ink)); }
/* foto primeiro; os dados vêm depois, ao lado dela; ações na ponta direita */
.perfil-capa__corpo { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start;
  column-gap: 20px; padding: 0 22px 20px; margin-top: -46px; }
.perfil-capa__dados { padding-top: 50px; }
.perfil-capa__nome { font-size: 22px; letter-spacing: -.02em; }
.perfil-capa__email { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.perfil-capa__selos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.perfil-capa__acoes { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; padding-top: 50px; }
.perfil-capa__dica { text-align: right; }
.badge.perfil-selo--moeda { background: color-mix(in srgb, var(--fx-ouro) 14%, var(--surface)); color: var(--fx-ouro);
  border-color: color-mix(in srgb, var(--fx-ouro) 35%, transparent); }
.badge.perfil-selo--patente { background: color-mix(in srgb, var(--fx, var(--muted)) 10%, var(--surface)); color: var(--fx, var(--muted));
  border-color: color-mix(in srgb, var(--fx, var(--muted)) 35%, transparent); }
.perfil-capa__selos .nivel-selo { font-size: 11.5px; }

/* MEU PERFIL — marcadores da conta ativa: AudioCash, score, desafios, visitas, vínculos e conquistas */
.perfil-marc { margin-bottom: 18px; }
.perfil-marc__head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; margin: 0 0 12px; }
.perfil-marc__head h2 { font-size: 18px; letter-spacing: -.01em; }
.perfil-marc__grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 14px; }
.perfil-marc__cartao { display: flex; flex-direction: column; gap: 4px; min-width: 0; min-height: 172px; margin: 0; padding: 16px 18px;
  background: radial-gradient(260px 140px at 0% 0%, color-mix(in srgb, var(--fx, var(--lime)) 11%, transparent), transparent 70%), var(--surface); }
.perfil-marc__grade > .perfil-marc__cartao { margin: 0; } /* sem o margin-top de .card + .card: os quatro alinhados */
.perfil-marc__rotulo { font: 600 11px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); overflow-wrap: anywhere; }
.perfil-marc__num { margin-top: 4px; font: 800 40px/1 var(--font-display); letter-spacing: -.03em; color: var(--ink); }
.perfil-marc__num--score { color: var(--fx, var(--ink)); }
.perfil-marc__cartao > small { font-size: 12.5px; color: var(--muted); }
.perfil-marc__linha { margin-top: 4px; font-size: 12.5px; color: var(--ink-body); text-decoration: none; overflow-wrap: anywhere; }
a.perfil-marc__linha:hover { text-decoration: underline; }
.perfil-marc__cartao .badge { align-self: flex-start; margin-top: 4px; }
.perfil-marc__cartao .pont-estrelas { margin-top: 4px; }
.perfil-marc__meds { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 4px; font-size: 12px; color: var(--muted); }
.perfil-marc__meds b { color: var(--fx); font-weight: 700; }
.perfil-marc__link { margin-top: auto; padding-top: 8px; font-size: 13px; font-weight: 600; color: var(--lime-ink); text-decoration: none; }
.perfil-marc__link:hover { text-decoration: underline; }
.perfil-marc__detalhe > .card { margin: 0; }
.perfil-marc__vazio { margin: 0; }
.perfil-vinc { list-style: none; margin: 0; padding: 0; }
.perfil-vinc__item { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.3fr) 90px; align-items: center; gap: 8px 14px;
  padding: 12px 20px; border-top: 1px solid var(--border); }
.perfil-vinc__item:first-child { border-top: 0; }
.perfil-vinc__quem { display: grid; gap: 1px; min-width: 0; }
.perfil-vinc__tipo { font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.perfil-vinc__nome { font: 650 14.5px/1.3 var(--font-display); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.perfil-vinc__nome:hover { text-decoration: underline; }
.perfil-vinc__nivel { display: grid; justify-items: start; gap: 4px; min-width: 0; }
.perfil-vinc__nivel small { font-size: 12px; color: var(--muted); }
.perfil-vinc__prog { position: relative; width: 100%; max-width: 200px; height: 6px; overflow: hidden; border-radius: 999px; background: var(--surface-2); }
.perfil-vinc__prog i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: var(--nivel); }
.perfil-vinc__score { display: grid; justify-items: end; text-align: right; color: var(--fx, var(--muted)); }
.perfil-vinc__score b { font: 750 22px/1 var(--font-display); letter-spacing: -.02em; }
.perfil-vinc__score span { font: 650 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.perfil-vinc__score span.muted { font: 400 12px/1.4 var(--font-body); text-transform: none; letter-spacing: 0; }
@media (max-width: 560px) {
  .perfil-vinc__item { grid-template-columns: minmax(0, 1fr) auto; }
  .perfil-vinc__nivel { grid-column: 1 / -1; grid-row: 2; }
}
.perfil-conq { display: flex; flex-wrap: wrap; gap: 6px; }
.perfil-conq__item { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px 4px 7px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--ink); background: color-mix(in srgb, var(--fx-ouro) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--fx-ouro) 35%, transparent); }
.perfil-conq__item svg { width: 15px; height: 15px; fill: none; stroke: var(--fx-ouro); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.perfil-conq__item b { color: var(--fx-verde); }
.perfil-mov { list-style: none; margin: 14px 0 0; padding: 0; }
.perfil-mov li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 12px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 13px; }
.perfil-mov li > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.perfil-mov em { font: 700 13px/1.4 var(--font-mono); font-style: normal; }
.perfil-mov em.pos { color: var(--fx-verde); }
.perfil-mov em.neg { color: var(--fx-vermelho); }
.perfil-mov small { grid-column: 1 / -1; font-size: 11.5px; color: var(--muted); }

/* EQUIPAMENTO → PAINEL TV (studio/tv.ejs): como conectar e o atalho do código; a TV e o celular usam o tv.css */
.tvg-conectar { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 20px 36px; margin-bottom: 16px; padding: 22px 26px; }
.tvg-conectar__qr { display: grid; justify-items: center; gap: 8px; }
.tvg-qr { width: 200px; max-width: 100%; aspect-ratio: 1; padding: 10px; border-radius: 14px; background: #fff; border: 1px solid var(--border); }
.tvg-qr svg { display: block; width: 100%; height: 100%; }
.tvg-conectar__codigo { font: 700 24px/1 var(--font-mono); letter-spacing: .12em; color: var(--ink); }
.tvg-conectar__qr small { font-size: 12px; color: var(--muted); }
.tvg-conectar__texto { display: grid; gap: 14px; min-width: 0; }
.tvg-conectar__texto h2 { font-size: 20px; letter-spacing: -.01em; }
.tvg-passos { display: grid; gap: 8px; margin: 0; padding-left: 20px; font-size: 14px; }
.tvg-acoes { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.tvg-codigo { display: flex; align-items: flex-end; gap: 8px; max-width: 440px; }
.tvg-codigo .field { flex: 1; margin: 0; }
.tvg-codigo input { font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
@media (max-width: 760px) { .tvg-conectar { grid-template-columns: minmax(0, 1fr); padding: 18px; } }

/* USUÁRIOS → CHAVES DA API (studio/api-chaves.ejs, api-chave-form.ejs, api-chave-criada.ejs) */
.chv-acesso { display: inline-flex; align-items: center; gap: 5px; margin: 0 4px 4px 0; padding: 2px 3px 2px 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: var(--ink); background: var(--surface-2); border: 1px solid var(--border); white-space: nowrap; }
.chv-acesso i { padding: 0 6px; border-radius: 999px; font: 600 10px/1.6 var(--font-mono); font-style: normal; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted); background: var(--surface); }
.chv-acesso--escrita i { color: var(--warn-fg); background: var(--warn-bg); }
.chv-papeis .opcao--off { opacity: .55; cursor: not-allowed; }
.chv-nota { margin: 0 0 10px; }
.chv-acessos { display: grid; overflow: hidden; border: 1px solid var(--border); border-radius: 12px; }
.chv-acessos__cab, .chv-acessos__linha { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, 140px); align-items: center; gap: 6px; }
.chv-acessos__cab { padding: 9px 14px; font: 600 11px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); }
.chv-acessos__cab span:not(:first-child) { text-align: center; }
.chv-acessos__linha { padding: 10px 14px; border-top: 1px solid var(--border); }
.chv-acessos__nome { display: grid; gap: 2px; min-width: 0; }
.chv-acessos__nome b { font: 600 14px/1.3 var(--font-display); color: var(--ink); }
.chv-acessos__nome small { font-size: 12px; color: var(--muted); }
.chv-acessos__op { position: relative; display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0; padding: 7px 8px;
  border-radius: 999px; font-size: 13px; cursor: pointer; }
.chv-acessos__op input { width: 17px; height: 17px; margin: 0; accent-color: var(--lime-ink); }
.chv-acessos__op span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.chv-acessos__op:has(input:checked) { background: var(--lime-soft); }
.chv-acessos__op--off { opacity: .35; cursor: not-allowed; }
@media (max-width: 760px) {
  .chv-acessos__cab { display: none; }
  .chv-acessos__linha { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .chv-acessos__nome { grid-column: 1 / -1; }
  .chv-acessos__op { justify-content: flex-start; border: 1px solid var(--border); }
  .chv-acessos__op span { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: 12px; white-space: normal; }
}
/* ---- abrangência em árvore (campo de formulário: partials/abr-arvore) ---- */
.abr-arvore { display: grid; gap: 10px; }
.abr-arvore__resumo { display: grid; gap: 2px; padding: 11px 14px; border-radius: 12px; background: var(--lime-soft);
  border: 1px solid color-mix(in srgb, var(--lime-ink) 30%, transparent); }
.abr-arvore__rotulo { font: 600 11px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.abr-arvore__resumo b { font: 650 15px/1.35 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.abr-arvore__resumo small { font-size: 12.5px; color: var(--ink-body); }
.abr-arvore__barra { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.abr-arvore__barra[hidden], .abr-arvore__item[hidden] { display: none; }
input.abr-arvore__busca { flex: 1 1 240px; min-width: 0; padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
input.abr-arvore__busca::placeholder { color: var(--muted); }
input.abr-arvore__busca:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.abr-arvore__lista { position: relative; list-style: none; margin: 0; padding: 6px; max-height: 440px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); }
.abr-arvore__item { position: relative; display: flex; align-items: center; gap: 2px; padding-left: calc(var(--prof) * 24px); }
/* linhas guia: uma por nível acima, alinhadas com a seta do pai */
.abr-arvore__item::before { content: ""; position: absolute; left: 6px; top: 0; bottom: 0; width: calc(var(--prof) * 24px); pointer-events: none;
  background: repeating-linear-gradient(to right, transparent 0 11px, var(--border-strong) 11px 12px, transparent 12px 24px); }
.abr-arvore__abre { flex: none; display: grid; place-items: center; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 6px;
  background: none; color: var(--muted); cursor: pointer; }
button.abr-arvore__abre:hover { background: var(--surface-2); color: var(--ink); }
button.abr-arvore__abre:disabled { cursor: default; opacity: .45; }
.abr-arvore__abre svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.abr-arvore__abre[aria-expanded="false"] svg { transform: rotate(-90deg); }
.abr-arvore:not(.com-js) .abr-arvore__abre { visibility: hidden; }
.abr-arvore__no { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; margin: 1px 0; padding: 6px 10px;
  border: 1px solid transparent; border-radius: 9px; cursor: pointer; }
.abr-arvore__no:hover { background: var(--surface-2); }
.abr-arvore__no:has(input:checked) { background: var(--lime-soft); border-color: var(--lime-ink); }
.abr-arvore__no input { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--lime-ink); }
.abr-arvore__ico { flex: none; width: 17px; height: 17px; fill: none; stroke: var(--nv); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.abr-arvore__txt { display: grid; min-width: 0; line-height: 1.25; }
.abr-arvore__txt b { font: 600 14px/1.3 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abr-arvore__txt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* agrupador: sem rádio, alinhado com os nós que têm (16px do rádio + 9px de espaço) */
.abr-arvore__no--sem { cursor: default; padding-left: 35px; }
.abr-arvore__no--sem:hover { background: none; }
.abr-arvore__no--sem b { font-style: italic; font-weight: 500; color: var(--muted); }
.abr-arvore__no--sem .abr-arvore__ico { stroke: var(--muted); }
/* o caminho até o marcado fica em negrito; o que a busca achou ganha contorno */
.abr-arvore__item--caminho .abr-arvore__txt b { font-weight: 750; }
.abr-arvore__item.achado > .abr-arvore__no { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--lime-ink) 45%, transparent); }
.abr-arvore__vazio { margin: 0; padding: 4px 2px; color: var(--muted); font-size: 13px; }
@media (max-width: 560px) {
  .abr-arvore__item { padding-left: calc(var(--prof) * 14px); }
  .abr-arvore__item::before { left: 1px; width: calc(var(--prof) * 14px);
    background: repeating-linear-gradient(to right, transparent 0 6px, var(--border-strong) 6px 7px, transparent 7px 14px); }
}
.chv-criada__aviso { margin: 0 0 12px; padding: 12px 14px; border-radius: 10px; color: var(--warn-fg); background: var(--warn-bg); border: 1px solid var(--warn-bd); }
.chv-segredo { display: flex; gap: 8px; }
.chv-segredo input { flex: 1; min-width: 0; padding: 12px 14px; font: 600 15px/1.2 var(--font-mono); letter-spacing: .02em; }
.chv-resumo { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 20px; margin: 18px 0; }
.chv-resumo div { display: grid; gap: 2px; }
.chv-resumo .chv-resumo__largo { grid-column: 1 / -1; }
.chv-resumo dt { font: 600 11px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.chv-resumo dd { margin: 0; font-size: 14px; }
.chv-criada__titulo { margin: 8px 0 4px; font-size: 16px; }
.chv-exemplo { margin: 8px 0 0; padding: 12px 14px; overflow-x: auto; border-radius: 10px; font: 13px/1.5 var(--font-mono); background: var(--surface-2); border: 1px solid var(--border); }
@media (max-width: 780px) {
  .perfil-capa__corpo { grid-template-columns: 1fr; justify-items: start; row-gap: 10px; }
  .perfil-capa__dados, .perfil-capa__acoes { padding-top: 0; }
  .perfil-capa__acoes { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .perfil-capa__dica { text-align: left; }
}

.perfil-foto { flex: none; }
.perfil-foto__alvo { position: relative; display: inline-block; width: 112px; height: 112px; cursor: pointer; z-index: 1; }
.perfil-foto__moldura { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 50%;
  overflow: hidden; background: var(--navy); color: #fff; border: 4px solid var(--surface); box-shadow: var(--shadow-sm); }
.perfil-foto__moldura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.perfil-foto__iniciais { font: 700 32px/1 var(--font-display); letter-spacing: -.02em; }
.perfil-foto__lapis { position: absolute; right: -4px; bottom: -4px; z-index: 2; width: 32px; height: 32px; border-radius: 50%;
  background: var(--lime); color: #16220b; display: grid; place-items: center; border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm); }
.perfil-foto__lapis svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.perfil-foto__alvo:hover .perfil-foto__lapis { background: #c8ff63; }
@media (max-width: 600px) { .perfil-capa__corpo { margin-top: -48px; } }

/* ---- modal de ajuste da foto ---- */
.modal-foto { max-width: 420px; }
.cortador { position: relative; width: 320px; max-width: 100%; height: 320px; margin: 0 auto; border-radius: var(--r);
  overflow: hidden; background: var(--surface-2); touch-action: none; }
.cortador canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.cortador canvas:active { cursor: grabbing; }
.cortador__mascara { position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at center, transparent 0 49.4%, rgba(10,22,40,.55) 50%);
  box-shadow: inset 0 0 0 1px var(--border); }
:root[data-tema="escuro"] .cortador__mascara { background: radial-gradient(circle at center, transparent 0 49.4%, rgba(0,0,0,.6) 50%); }
#zoomFoto { accent-color: var(--lime-ink); }

/* =================================================================
   ESTRUTURA — a abrangência como organograma (uma caixa por item)
   .org--organograma  filhos lado a lado, ligados por linhas (padrão)
   .org--recuo        lista em árvore, filhos recuados abaixo do pai
   ================================================================= */
/* cor de cada nível (faixa no topo da caixa e ícone), com contraparte no escuro */
:root { --nv-conta: #0A1628; --nv-regional: #2f63c9; --nv-franquia: #4f7d14; --nv-carteira: #b26a00; --nv-parceiro: #7a4fc4; }
:root[data-tema="escuro"] { --nv-conta: #eef3fa; --nv-regional: #86adff; --nv-franquia: #cbff70; --nv-carteira: #ffc56b; --nv-parceiro: #bfa2ff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]):not([data-tema="escuro"]) {
    --nv-conta: #eef3fa; --nv-regional: #86adff; --nv-franquia: #cbff70; --nv-carteira: #ffc56b; --nv-parceiro: #bfa2ff; }
}

.org-ctl[hidden] { display: none; }
.org-ctl .seg__btn { border: 0; background: none; font: 600 12px/1 var(--font-mono); cursor: pointer; }
.org-ctl .seg__btn + .seg__btn { border-left: 1px solid var(--border); }
.org-ctl .seg__btn:hover { color: var(--ink); background: var(--surface-2); }
.org-ctl .seg__btn.on { background: var(--sel-bg); color: var(--sel-fg); }
.org-ctl .seg__btn:disabled { opacity: .4; cursor: not-allowed; background: none; }
.org-ctl .org-zoom__valor { width: 56px; color: var(--ink-body); }

.org-quadro { overflow: hidden; }
.org-rolagem { overflow: auto; padding: 26px 24px 34px; min-height: 340px; max-height: calc(100vh - 290px);
  background-image: radial-gradient(var(--border) 1px, transparent 1px); background-size: 18px 18px; }
.org-rolagem:has(.org--organograma) { cursor: grab; }
.org-rolagem.arrastando { cursor: grabbing; user-select: none; }
.org-rolagem:has(.org--recuo) { max-height: none; background-image: none; }
.org, .org ul { list-style: none; margin: 0; padding: 0; }
.org { zoom: var(--org-zoom, 1); }
.org__vazio { padding: 0 24px 22px; color: var(--muted); font-size: 13.5px; }

/* ---- a caixa: mesmo tamanho para todas ---- */
.org__caixa { --nv: var(--nv-conta); position: relative; width: 232px; min-height: 158px; display: flex; flex-direction: column; gap: 5px;
  padding: 13px 14px 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--shadow-sm); text-align: left; cursor: auto; transition: box-shadow .15s, opacity .15s; }
.org__caixa::before { content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 4px;
  border-radius: var(--r) var(--r) 0 0; background: var(--nv); }
.org__caixa:hover { box-shadow: var(--shadow); }
/* o nível ativo (raiz do desenho) */
.org__caixa--raiz { border-color: color-mix(in srgb, var(--nv) 55%, transparent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--nv) 16%, transparent), var(--shadow-sm); }
/* agrupadores "Sem regional" / "Sem carteira" */
.org__caixa--sem { background: var(--surface-2); border-style: dashed; border-color: var(--border-strong); }
.org__caixa--sem::before { opacity: .45; }
.org__caixa--sem .org__nome { font-style: italic; color: var(--muted); }

.org__topo { display: flex; align-items: center; gap: 7px; min-width: 0; }
.org__topo svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--nv); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.org__tipo { font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.org__cod { margin-left: auto; max-width: 90px; padding: 0 7px; border: 1px solid var(--border); border-radius: 999px;
  font: 500 11px/1.5 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org__nome { font: 650 15px/1.25 var(--font-display); color: var(--ink); text-decoration: none; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
a.org__nome:hover { text-decoration: underline; text-underline-offset: 3px; }
.org__admin { display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 19px; font-size: 12.5px; color: var(--ink-body); }
.org__admin span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org__admin svg { width: 13px; height: 13px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; opacity: .6; }
.org__dados { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.org__dados .nivel-selo { font-size: 11.5px; padding: 1px 8px 1px 6px; }
.org__num { font-size: 12px; color: var(--muted); white-space: nowrap; }
.org__num b { font: 650 12.5px/1 var(--font-display); color: var(--ink); }
.org__pe { margin-top: auto; display: flex; align-items: center; gap: 6px; min-height: 36px; padding-top: 6px; border-top: 1px solid var(--border); }
.org__abre { display: inline-flex; align-items: center; gap: 4px; margin-left: -5px; padding: 4px 8px 4px 5px; border: 0; border-radius: 7px;
  background: none; color: var(--ink-body); font: 600 12.5px/1.2 var(--font-body); cursor: pointer; }
.org__abre:hover { background: var(--surface-2); color: var(--ink); }
.org__abre svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.org__abre[aria-expanded="false"] svg { transform: rotate(-90deg); }
.org__folha { font-size: 12px; color: var(--muted); }
.org__ir { margin-left: auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; color: var(--muted); }
.org__ir:hover { background: var(--lime-soft); color: var(--ink); }
.org__ir svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.org__abre:focus-visible, .org__ir:focus-visible, a.org__nome:focus-visible { outline: 2px solid var(--lime-ink); outline-offset: 2px; }

/* busca: quem casa ganha contorno, o resto esmaece */
.org.buscando .org__caixa { opacity: .4; }
.org.buscando .org__caixa.achado { opacity: 1; outline: 2px solid var(--lime-ink); outline-offset: 2px; }
/* ramos recolhidos — só com JS; sem JS tudo fica aberto */
.org.com-js li.fechado > ul { display: none; }

/* ---- organograma: filhos lado a lado, ligados por linhas ---- */
.org--organograma { display: flex; justify-content: center; min-width: max-content; }
.org--organograma ul { display: flex; justify-content: center; position: relative; padding-top: 22px; }
.org--organograma li { display: flex; flex-direction: column; align-items: center; position: relative; padding: 22px 7px 0; }
.org--organograma > li { padding-top: 0; }
/* traço que desce do pai */
.org--organograma ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; margin-left: -1px;
  border-left: 2px solid var(--border-strong); }
/* traço horizontal que une os irmãos + vertical até cada caixa */
.org--organograma li li::before, .org--organograma li li::after { content: ""; position: absolute; top: 0; width: 50%; height: 22px;
  border-top: 2px solid var(--border-strong); }
.org--organograma li li::before { right: 50%; }
.org--organograma li li::after { left: 50%; margin-left: -1px; border-left: 2px solid var(--border-strong); }
.org--organograma li li:first-child::before, .org--organograma li li:last-child::after { border: 0 none; }
.org--organograma li li:last-child::before { margin-right: -1px; border-right: 2px solid var(--border-strong); border-top-right-radius: 10px; }
.org--organograma li li:first-child::after { border-top-left-radius: 10px; }
.org--organograma li li:only-child::before, .org--organograma li li:only-child::after { display: none; }
.org--organograma li li:only-child { padding-top: 0; }

/* ---- lista em árvore: filhos recuados, linhas à esquerda ---- */
/* a lista tem largura máxima; cada nível estreita pelo recuo e as bordas direitas ficam alinhadas */
.org--recuo { display: block; max-width: 860px; }
.org--recuo ul { display: grid; gap: 10px; padding: 10px 0 0 34px; }
.org--recuo li { position: relative; }
.org--recuo li li::before { content: ""; position: absolute; left: -20px; top: -10px; width: 20px; height: 42px;
  border-left: 2px solid var(--border-strong); border-bottom: 2px solid var(--border-strong); border-bottom-left-radius: 10px; }
.org--recuo li li:not(:last-child)::after { content: ""; position: absolute; left: -20px; top: -10px; bottom: -10px;
  border-left: 2px solid var(--border-strong); }
.org--recuo .org__caixa { width: 100%; min-height: 0; display: grid; align-items: center; column-gap: 16px; row-gap: 3px;
  grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "topo dados" "nome pe" "admin pe"; padding: 11px 14px 10px 16px; }
.org--recuo .org__caixa::before { top: -1px; bottom: -1px; left: -1px; right: auto; width: 4px; height: auto; border-radius: var(--r) 0 0 var(--r); }
.org--recuo .org__topo { grid-area: topo; }
.org--recuo .org__nome { grid-area: nome; }
.org--recuo .org__admin { grid-area: admin; }
.org--recuo .org__dados { grid-area: dados; justify-content: flex-end; }
.org--recuo .org__pe { grid-area: pe; justify-content: flex-end; margin: 0; padding: 0; min-height: 0; border: 0; }
.org--recuo .org__ir { margin-left: 0; }
@media (max-width: 560px) {
  .org-rolagem { padding: 18px 14px 24px; }
  .org--recuo ul { padding-left: 22px; }
  .org--recuo li li::before, .org--recuo li li:not(:last-child)::after { left: -13px; }
  .org--recuo li li::before { width: 13px; }
  .org--recuo .org__caixa { grid-template-columns: minmax(0, 1fr); grid-template-areas: "topo" "nome" "admin" "dados" "pe"; }
  .org--recuo .org__dados, .org--recuo .org__pe { justify-content: flex-start; }
}

/* =================================================================
   PESSOA — usuário administrador dos cadastros (parcial admin-pessoa)
   foto (ou iniciais) + nome, e-mail e, se estiver na Equipe, cargo e telefone
   ================================================================= */
.pessoa { display: inline-flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; vertical-align: middle; text-align: left; }
.pessoa__foto { width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover;
  background: var(--surface-2); border: 1px solid var(--border); }
.pessoa__foto--iniciais { display: grid; place-items: center; background: var(--sel-bg); color: var(--sel-fg);
  border-color: transparent; font: 700 12px/1 var(--font-display); letter-spacing: .02em; }
.pessoa__foto--mini { width: 20px; height: 20px; font-size: 8.5px; }
.pessoa__txt { display: grid; min-width: 0; line-height: 1.3; }
.pessoa__txt b { font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pessoa__txt small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* prévia de quem está escolhido, logo abaixo do seletor do formulário */
.pessoa-previa { display: flex; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); font-weight: 400; }
.pessoa-previa[hidden] { display: none; }

/* =================================================================
   SCORE — Força, Foco e Resiliência (regra em src/lib/pontuacao.js)
   faixas: vermelho < 500 · verde (equilíbrio) < 600 · ouro (meia meta) < 700 · na meta
   ================================================================= */
:root { --fx-vermelho: #c0392b; --fx-verde: #2e7d32; --fx-ouro: #a87408; --fx-meta: #2f63c9; }
:root[data-tema="escuro"] { --fx-vermelho: #ff7a6e; --fx-verde: #5fd98f; --fx-ouro: #f2c14e; --fx-meta: #86adff; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]):not([data-tema="escuro"]) {
    --fx-vermelho: #ff7a6e; --fx-verde: #5fd98f; --fx-ouro: #f2c14e; --fx-meta: #86adff; }
}
.fx--vermelho { --fx: var(--fx-vermelho); }
.fx--verde { --fx: var(--fx-verde); }
.fx--ouro { --fx: var(--fx-ouro); }
.fx--meta { --fx: var(--fx-meta); }
[data-so-js][hidden] { display: none !important; }
input[type=month] { padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--surface);
  color: var(--ink); font: 500 14px/1.3 var(--font-body); }
input[type=month]:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.org-mes, .pont-mes, .org-mes label, .pont-mes label { display: flex; align-items: center; gap: 8px; }

/* pontos coloridos pela faixa */
.pts { display: inline-flex; align-items: center; justify-content: center; min-width: 46px; padding: 2px 8px; border-radius: 999px;
  font: 650 12.5px/1.5 var(--font-mono); color: var(--fx, var(--muted));
  background: color-mix(in srgb, var(--fx, var(--muted)) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--fx, var(--muted)) 38%, transparent); }
.pts--grande { min-width: 58px; padding: 3px 11px; font-size: 14.5px; }
.pts--vazio { color: var(--muted); background: transparent; border: 1px dashed var(--border-strong); }

/* ---- simulador ---- */
.pont-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
.pont-grid > .card + .card { margin-top: 0; }
@media (max-width: 1050px) { .pont-grid { grid-template-columns: 1fr; } }
.pont-campos { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; }
.pont-campos input { font-family: var(--font-mono); }
.pont-res__topo { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 20px; border-bottom: 1px solid var(--border); }
.pont-score { display: grid; place-items: center; align-content: center; width: 118px; height: 118px; flex: none; border-radius: 50%;
  border: 6px solid var(--fx); background: color-mix(in srgb, var(--fx) 8%, var(--surface)); }
.pont-score b { font: 750 34px/1 var(--font-display); color: var(--fx); letter-spacing: -.03em; }
.pont-score small { margin-top: 4px; font: 600 10px/1 var(--font-mono); letter-spacing: .12em; color: var(--muted); }
.pont-patente { display: grid; gap: 6px; }
.pont-patente b { font: 700 24px/1.1 var(--font-display); color: var(--ink); }
.pont-estrelas { display: flex; gap: 4px; }
.pont-estrelas i { width: 22px; height: 6px; border-radius: 3px; background: var(--border-strong); }
.pont-estrelas i.on { background: var(--fx); }
.pont-faixa { justify-self: start; padding: 2px 10px; border-radius: 999px; font: 650 11px/1.6 var(--font-mono); text-transform: uppercase;
  letter-spacing: .06em; color: var(--fx); background: color-mix(in srgb, var(--fx) 12%, var(--surface)); }
.pont-linha { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 14px; padding: 14px 20px;
  border-bottom: 1px solid var(--border); }
.pont-linha__nome b { font: 650 15px/1.2 var(--font-display); color: var(--ink); }
.pont-linha__nome small { display: block; font-size: 12px; color: var(--muted); }
.pont-barra { grid-column: 1 / -1; position: relative; height: 8px; border-radius: 999px; background: var(--surface-2); }
.pont-barra i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 999px; background: var(--fx); transition: width .2s; }
/* marcas das faixas: 500, 600 e 700 (a meta, mais forte) */
.pont-barra::after { content: ""; position: absolute; inset: -3px 0; pointer-events: none;
  background: linear-gradient(90deg, transparent calc(50% - 1px), var(--border-strong) calc(50% - 1px) 50%, transparent 50% calc(60% - 1px),
    var(--border-strong) calc(60% - 1px) 60%, transparent 60% calc(70% - 1px), var(--ink) calc(70% - 1px) 70%, transparent 70%); }
.pont-linha__conta { grid-column: 1 / -1; font: 12px/1.45 var(--font-mono); color: var(--muted); }
.pont-soma { padding: 14px 20px; font: 12.5px/1.5 var(--font-mono); color: var(--ink-body); }
.pont-regra__grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px 28px; }
.pont-regra h3 { font-size: 14px; margin-bottom: 8px; }
.pont-regra table { font-size: 13px; }
.pont-regra th, .pont-regra td { padding: 6px 8px; }
.pont-regra p { font-size: 13px; color: var(--ink-body); margin-top: 8px; }

/* ---- medições do mês ---- */
.pont-total { display: flex; align-items: center; gap: 14px 26px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 14px; }
.pont-total h2 { font-size: 17px; }
.pont-total__score { display: flex; align-items: center; gap: 10px; font: 600 12px/1.3 var(--font-mono); text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); }
.pont-total__meds { display: flex; gap: 14px; flex-wrap: wrap; }
.pont-total__med { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-body); }
/* compacta: cabe em ~1100px de conteúdo; abaixo disso a tabela rola na horizontal (.tbl) */
.pont-tabela table { min-width: 1060px; font-size: 13.5px; }
.pont-tabela thead th { position: static; white-space: nowrap; padding: 10px 6px; text-align: center; }
.pont-tabela .pont-th { border-bottom: 1px solid var(--border); color: var(--ink-body); }
.pont-tabela td { padding: 7px 6px; white-space: nowrap; text-align: center; }
.pont-tabela td:first-child { white-space: normal; min-width: 170px; text-align: left; }
.pont-tabela input { width: 62px; padding: 6px 7px; text-align: center; font: 500 13px/1.3 var(--font-mono); }
.pont-tabela .pts { min-width: 42px; padding: 2px 6px; }
.pont-tabela .pts--grande { min-width: 50px; }
.pont-tabela .pont-sep { border-left: 1px solid var(--border); }
.pont-tabela tbody tr.pont-grupo td { background: var(--surface-2); }
.pont-tabela tbody tr.pont-grupo--regional td { font-family: var(--font-display); color: var(--ink); border-top: 2px solid var(--border-strong); }
.pont-recuo { display: inline-flex; align-items: center; gap: 6px; padding-left: 16px; }
.pont-recuo--2 { padding-left: 32px; }
/* filtros por medição e cor (só com JS) */
.pont-filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px; padding: 12px 20px; margin: 0 0 14px; }
.pont-filtros[hidden], .pont-filtros [hidden] { display: none; }
.pont-filtros__grupo { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.pont-filtros__cor i { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--fx, var(--muted)); }
.pont-filtros__cor[data-filtro-cor="sem"] i { background: transparent; border: 1px dashed currentColor; }
.pont-filtros__conta { font: 600 12px/1.4 var(--font-mono); color: var(--muted); }
.pont-filtros__conta:empty { display: none; }
.pont-tabela tr[data-filtro-vazio] td { padding: 22px 20px; text-align: left; color: var(--muted); }

/* ---- caixas do Nível (organograma): score do mês ---- */
.org--organograma .org__caixa { min-height: 292px; }
.org__pont { display: grid; gap: 5px; padding-top: 7px; border-top: 1px dashed var(--border); }
.org__score, .org__vazia { display: flex; align-items: center; gap: 11px; min-width: 0; }
/* bolinha: anel de 0 a 1000 na cor da faixa, número no meio */
.org__bola { position: relative; width: 56px; height: 56px; flex: none; }
.org__bola svg { display: block; width: 100%; height: 100%; overflow: visible; }
.org__bola-trilho { fill: color-mix(in srgb, var(--fx, var(--muted)) 9%, var(--surface)); stroke: var(--surface-2); stroke-width: 5; }
.org__bola-valor { fill: none; stroke: var(--fx, var(--muted)); stroke-width: 5; stroke-linecap: round; }
.org__bola b { position: absolute; inset: 0; display: grid; place-items: center; font: 750 16px/1 var(--font-display);
  letter-spacing: -.03em; color: var(--fx, var(--muted)); }
.org__bola--sem .org__bola-trilho { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.6; stroke-dasharray: 3 3; }
.org__score-info { display: grid; justify-items: start; gap: 6px; min-width: 0; }
.org__score-info span { padding: 2px 9px; border-radius: 999px; font: 650 10.5px/1.4 var(--font-mono); text-transform: uppercase;
  letter-spacing: .08em; color: var(--fx); background: color-mix(in srgb, var(--fx) 13%, var(--surface)); white-space: nowrap; }
.org__estrelas { gap: 3px; }
.org__estrelas i { width: 13px; height: 4px; border-radius: 2px; }
.org__score small { font-size: 11px; color: var(--muted); }
.org__meds { display: grid; gap: 1px; }
.org__med { display: grid; grid-template-columns: 78px minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: 11.5px; line-height: 1.5; }
.org__med span { display: flex; align-items: center; gap: 5px; font-weight: 600; color: var(--ink-body); }
.org__med span::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--fx); }
.org__med em { font: normal 400 10.5px/1.5 var(--font-mono); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org__med b { min-width: 30px; text-align: right; font: 650 11.5px/1.5 var(--font-mono); color: var(--fx); }
.org__semmed { font-size: 12px; color: var(--muted); }
.org--recuo .org__caixa { grid-template-areas: "topo dados" "nome pe" "admin pe" "pont pont"; }
.org--recuo .org__pont { grid-area: pont; grid-template-columns: auto minmax(0, 1fr); align-items: center; column-gap: 18px; margin-top: 4px; }
.org--recuo .org__meds { grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 16px; }
@media (max-width: 560px) {
  .org--recuo .org__caixa { grid-template-areas: "topo" "nome" "admin" "dados" "pont" "pe"; }
  .org--recuo .org__pont, .org--recuo .org__meds { grid-template-columns: minmax(0, 1fr); }
}

/* =================================================================
   GAMIFICAÇÃO — botão do topo (score da camada + saldo), desafios, loja e extrato
   ================================================================= */
.gami-btn { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink); font-family: inherit; cursor: pointer; }
.gami-btn:hover, .gami-btn[aria-expanded=true] { background: var(--surface-2); border-color: var(--border-strong); }
.gami-btn__score { display: flex; align-items: baseline; gap: 6px; padding: 5px 10px 5px 9px; border-radius: 999px;
  color: var(--fx, var(--muted)); background: color-mix(in srgb, var(--fx, var(--muted)) 13%, var(--surface)); }
.gami-btn__score b { font: 750 15px/1 var(--font-display); }
.gami-btn__score small { font: 650 10px/1 var(--font-mono); text-transform: uppercase; letter-spacing: .06em; }
.gami-btn__moeda { display: grid; text-align: left; line-height: 1.15; }
.gami-btn__moeda b { font: 700 14px/1.1 var(--font-display); }
.gami-btn__moeda small { font-size: 11px; color: var(--muted); }
/* quantos itens da loja o saldo troca */
.gami-btn__loja { display: flex; align-items: center; gap: 5px; padding-left: 10px; border-left: 1px solid var(--border); color: var(--ok); }
.gami-btn__loja svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.gami-btn__loja b { font: 700 14px/1 var(--font-display); color: var(--ink); }
.gami-btn__loja small { font-size: 11px; color: var(--muted); }
.gami-btn__loja.zero { color: var(--muted); }
@media (max-width: 720px) { .gami-btn__moeda small, .gami-btn__score small, .gami-btn__loja small { display: none; } }
.gami-menu { position: absolute; top: 58px; right: 22px; width: 380px; max-width: calc(100vw - 32px); max-height: calc(100vh - 80px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow); z-index: 60; }
.gami-menu__topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.gami-menu__rotulo { display: block; font: 650 14px/1.25 var(--font-display); color: var(--ink); }
.gami-menu__topo small { font-size: 11.5px; color: var(--muted); }
.gami-menu__score { display: grid; justify-items: end; color: var(--fx, var(--muted)); }
.gami-menu__score b { font: 750 28px/1 var(--font-display); letter-spacing: -.02em; }
.gami-menu__score span { font: 650 10.5px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.gami-menu__vazio { padding: 14px 16px; font-size: 13px; color: var(--muted); }
.gami-med { display: grid; gap: 7px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.gami-med__linha { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.gami-med__linha b { font: 650 13.5px/1.2 var(--font-display); color: var(--ink); }
.gami-med__linha em { font: normal 11.5px/1.2 var(--font-mono); color: var(--muted); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gami-med__passo { font-size: 12px; color: var(--ink-body); }
.gami-plano summary { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border: 1px solid var(--border-strong); border-radius: 999px;
  font: 600 12px/1.3 var(--font-display); color: var(--ink); cursor: pointer; list-style: none; }
.gami-plano summary::-webkit-details-marker { display: none; }
.gami-plano summary::before { content: "▸"; transition: transform .15s; }
.gami-plano[open] summary { background: var(--surface-2); }
.gami-plano[open] summary::before { transform: rotate(90deg); }
.gami-plano ul { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; color: var(--ink-body); }
.gami-menu__moeda { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.gami-menu__moeda div { display: grid; }
.gami-menu__moeda small { font-size: 11px; color: var(--muted); }
.gami-menu__moeda b { font: 700 15px/1.3 var(--font-display); color: var(--ink); }
.gami-menu__loja { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px;
  border-bottom: 1px solid var(--border); text-decoration: none; color: var(--ink); font-size: 13px; }
.gami-menu__loja:hover { background: var(--surface-2); }
.gami-menu__loja > b { min-width: 1.4em; font: 750 26px/1 var(--font-display); text-align: center; color: var(--ok); }
.gami-menu__loja.zero > b { color: var(--muted); }
.gami-menu__loja span { display: grid; gap: 2px; font-weight: 600; }
.gami-menu__loja small { font-size: 11.5px; font-weight: 400; color: var(--muted); }
.gami-menu__loja em { font: normal 600 12px/1 var(--font-display); color: var(--muted); white-space: nowrap; }
.gami-menu__links { display: flex; gap: 4px; padding: 8px; }
.gami-menu__links a { flex: 1; padding: 8px; border-radius: 9px; text-align: center; text-decoration: none; font: 600 13px/1 var(--font-display); color: var(--ink); }
.gami-menu__links a:hover { background: var(--surface-2); }

/* valor na moeda com os reais embaixo */
.cash { display: inline-grid; grid-template-columns: auto auto; align-items: baseline; justify-content: start; column-gap: 5px; line-height: 1.2; }
.cash b { font: 700 15px/1.2 var(--font-display); color: var(--ink); }
.cash__moeda { font-size: 12px; color: var(--muted); }
.cash small { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.cash--grande b { font-size: 24px; letter-spacing: -.02em; }
.gami-valor b { font: 700 14px/1.2 var(--font-display); }
.gami-valor small { font-size: 12px; color: var(--muted); }
.gami-valor.pos b { color: var(--ok); }
.gami-valor.neg b { color: var(--danger); }

.gami-cards { display: grid; grid-template-columns: repeat(auto-fill, 320px); justify-content: start; align-items: stretch; gap: 14px; }
@media (max-width: 700px) { .gami-cards { grid-template-columns: 1fr; } }
.gami-cards .ficha__corpo { display: grid; align-content: start; gap: 8px; }
/* item da loja: foto no topo do card (paisagem, recortada), categoria como etiqueta e crédito discreto */
.gami-item { overflow: hidden; }
.gami-item__foto { position: relative; aspect-ratio: 16 / 10; max-width: 100%; background: var(--surface-2); border-bottom: 1px solid var(--border);
  display: grid; place-items: center; }
.gami-item__foto img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.gami-item.inativa .gami-item__foto img { filter: grayscale(1); opacity: .6; }
.gami-item__sem-foto { font: 700 44px/1 var(--font-display); color: var(--muted); opacity: .45; }
.gami-item__cat { position: absolute; left: 10px; top: 10px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(10, 12, 14, .62); color: #fff; text-decoration: none; backdrop-filter: blur(4px); }
.gami-item__cat:hover { background: rgba(10, 12, 14, .8); }
.gami-item__credito { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 10px 4px; font-size: 10.5px; line-height: 1.3;
  color: rgba(255, 255, 255, .88); background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.loja-foto { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; align-items: start; }
@media (max-width: 700px) { .loja-foto { grid-template-columns: minmax(0, 1fr); } }
.loja-foto__previa { position: relative; aspect-ratio: 16 / 10; max-width: 100%; border: 1px dashed var(--border); border-radius: var(--r-md, 10px);
  background: var(--surface-2); display: grid; place-items: center; overflow: hidden; }
.loja-foto__previa img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gami-enviar textarea { min-height: 64px; font-size: 13px; }
.gami-saldo { display: flex; align-items: center; gap: 12px 24px; flex-wrap: wrap; padding: 16px 20px; margin-bottom: 14px; }
.gami-saldo .cad-toolbar__dir { margin-left: auto; }
.gami-alcance { display: grid; line-height: 1.2; padding-left: 24px; border-left: 1px solid var(--border); }
.gami-alcance b { font: 700 24px/1.2 var(--font-display); letter-spacing: -.02em; color: var(--ok); }
.gami-alcance.zero b { color: var(--muted); }
.gami-alcance div span { font-size: 12px; color: var(--muted); }
.gami-decisao { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.gami-decisao input[type=text] { width: 180px; padding: 6px 10px; font-size: 13px; }
.gami-comprovacao { max-width: 380px; white-space: pre-line; font-size: 13px; }
.gami-lancar { align-self: end; }
.gami-moeda { max-width: 760px; }
.form-secao[hidden] { display: none; }
.planos-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }
.planos-grade textarea { min-height: 150px; font-size: 13px; }

/* =================================================================
   NÍVEL — score da camada em destaque (topo da tela Nível)
   ================================================================= */
.nivel-hero { display: grid; grid-template-columns: auto minmax(220px, 1fr) minmax(300px, 1.3fr); align-items: center; gap: 20px 36px;
  padding: 24px 28px; margin-bottom: 16px; overflow: hidden;
  background: radial-gradient(460px 260px at 0% 0%, color-mix(in srgb, var(--fx, var(--muted)) 14%, transparent), transparent 72%), var(--surface); }
@media (max-width: 1150px) { .nivel-hero { grid-template-columns: auto minmax(0, 1fr); } .nivel-hero__meds { grid-column: 1 / -1; } }
@media (max-width: 620px) { .nivel-hero { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; } .nivel-hero__meds { width: 100%; text-align: left; } }
.nivel-hero__gauge { position: relative; width: 210px; height: 210px; flex: none; }
.nivel-hero__gauge svg { display: block; width: 100%; height: 100%; }
.nivel-hero__trilho { fill: none; stroke: var(--surface-2); stroke-width: 16; }
.nivel-hero__valor { fill: none; stroke: var(--fx, var(--muted)); stroke-width: 16; stroke-linecap: round; }
.nivel-hero__gauge line { stroke: var(--border-strong); stroke-width: 2; }
.nivel-hero__gauge line.meta { stroke: var(--ink); stroke-width: 3; }
.nivel-hero__num { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.nivel-hero__num b { font: 800 66px/.95 var(--font-display); letter-spacing: -.045em; color: var(--fx, var(--muted)); }
.nivel-hero__num span { margin-top: 4px; font: 600 11px/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.nivel-hero__rotulo { font: 600 11px/1.4 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.nivel-hero__nome { margin: 4px 0 8px; font-size: 26px; letter-spacing: -.02em; }
.nivel-hero__titulo { display: inline-flex; align-items: center; padding: 6px 16px; border-radius: 999px; font: 750 22px/1.15 var(--font-display);
  letter-spacing: -.01em; color: var(--fx, var(--muted)); background: color-mix(in srgb, var(--fx, var(--muted)) 14%, var(--surface)); }
.nivel-hero__estrelas { margin-top: 12px; }
.nivel-hero__estrelas i { width: 30px; height: 7px; }
.nivel-hero__dados { margin-top: 12px; font-size: 13px; color: var(--ink-body); }
.nivel-hero__alerta { margin-top: 8px; font-size: 13px; color: var(--fx-vermelho); }
.nivel-hero__gargalo { display: inline-block; margin-top: 8px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600;
  color: var(--fx-vermelho); background: color-mix(in srgb, var(--fx-vermelho) 12%, transparent); text-decoration: none; }
.nivel-hero__gargalo:hover { background: color-mix(in srgb, var(--fx-vermelho) 20%, transparent); }

/* NÍVEL — abas Gargalos × Árvore; o mês do score fica na mesma linha e vale para as duas */
.nivel-abas { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.nivel-abas .abas { border-bottom: 0; margin-bottom: 0; align-self: flex-end; }
.nivel-abas .org-mes { margin-left: auto; padding-block: 6px; }
@media (max-width: 620px) {
  .nivel-abas .org-mes { order: -1; margin-left: 0; }
  .nivel-abas .abas { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; }
  .nivel-abas .abas__item { padding-inline: 10px; white-space: nowrap; }
}
.abas__item--alerta span, .abas__item--alerta.on span { background: color-mix(in srgb, var(--fx-vermelho) 12%, var(--surface));
  color: var(--fx-vermelho); border-color: color-mix(in srgb, var(--fx-vermelho) 35%, transparent); }
.nivel-painel[hidden], [data-garg-filtro][hidden] { display: none; }

/* NÍVEL — gargalos: o que está vermelho no mês, o pior primeiro */
.gargalos { margin-bottom: 16px; overflow: hidden; border-color: color-mix(in srgb, var(--fx-vermelho) 40%, var(--border)); scroll-margin-top: 80px; }
.gargalos--ok { border-color: var(--border); }
.gargalos .card__head { flex-wrap: wrap; gap: 10px 12px; }
.gargalos__titulo { margin: 0; }
.gargalos__sem { margin: 0; }
.gargalos__sem + .btn { margin-top: 12px; }
.gargalos__ok { margin: 0; color: var(--fx-verde); font-weight: 600; }
/* filtros da aba Gargalos: busca, Tipo/Regional/Franquia (quando há mais de uma opção), medição, contador e limpar */
.gargalos__filtros { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 20px 14px; border-top: 1px solid var(--border); }
input.gargalos__busca { flex: 1 1 260px; min-width: 0; padding: 9px 16px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; }
input.gargalos__busca::placeholder { color: var(--muted); }
input.gargalos__busca:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.gargalos__sel { display: flex; align-items: center; gap: 6px; margin: 0; }
.gargalos__sel span { font-size: 12px; color: var(--muted); }
.gargalos__sel select { width: auto; min-width: 150px; max-width: 240px; padding: 8px 12px; }
.gargalos__conta { font: 600 12px/1.4 var(--font-mono); color: var(--muted); }
.gargalos__conta:empty, [data-garg-limpar][hidden] { display: none; }
.gargalos__vazio { margin: 0; padding: 18px 20px; border-top: 1px solid var(--border); color: var(--muted); }
@media (max-width: 620px) {
  .gargalos__sel { flex: 1 1 100%; }
  .gargalos__sel span { flex: 0 0 64px; }
  .gargalos__sel select { flex: 1; min-width: 0; max-width: none; }
}
button.chip { font: inherit; font-size: 13px; cursor: pointer; }
.gargalo { display: grid; grid-template-columns: minmax(190px, 1fr) minmax(260px, 2fr) 104px auto; align-items: center; gap: 10px 20px;
  padding: 13px 20px; border-top: 1px solid var(--border); }
.gargalo[hidden] { display: none; }
.gargalo__quem { display: grid; gap: 1px; min-width: 0; }
.gargalo__tipo { font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.gargalo__nome { font: 650 15px/1.3 var(--font-display); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.gargalo__nome:hover { text-decoration: underline; }
.gargalo__caminho, .gargalo__admin { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.gargalo__meds { display: grid; gap: 8px; }
.gargalo__med { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.gargalo__pts { font: 750 20px/1 var(--font-display); color: var(--fx-vermelho); text-align: right; letter-spacing: -.02em; }
.gargalo__med strong { font-size: 13.5px; }
.gargalo__real { font: 12px/1.3 var(--font-mono); color: var(--muted); }
.gargalo__med small { display: block; font-size: 12px; color: var(--muted); }
.gargalo__score { display: grid; justify-items: start; color: var(--fx-vermelho); }
.gargalo__score b { font: 750 22px/1 var(--font-display); letter-spacing: -.02em; }
.gargalo__score span { font: 650 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.gargalo__acoes { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
@media (max-width: 980px) {
  .gargalo { grid-template-columns: minmax(0, 1fr) auto; }
  .gargalo__meds { grid-column: 1 / -1; grid-row: 2; }
  .gargalo__acoes { grid-column: 1 / -1; justify-content: flex-start; }
}
/* na árvore: caixa vermelha com borda; destacando, o resto apaga; "Ver na árvore" pisca a caixa */
.org__caixa[data-gargalo] { border-color: color-mix(in srgb, var(--fx-vermelho) 55%, var(--border)); }
.org.org--gargalos .org__caixa { opacity: .3; }
.org.org--gargalos .org__caixa.gargalo-caminho { opacity: .75; }
.org.org--gargalos .org__caixa.gargalo-on { opacity: 1; outline: 2px solid var(--fx-vermelho); outline-offset: 2px; }
.org__caixa { scroll-margin: 90px; }
@keyframes org-piscar { 0%, 100% { outline-color: transparent; } 15%, 45%, 75% { outline-color: var(--fx-vermelho); } 30%, 60% { outline-color: transparent; } }
.org__caixa.piscar { outline: 3px solid transparent; outline-offset: 3px; animation: org-piscar 1.8s ease 1 forwards; opacity: 1; }
@media (prefers-reduced-motion: reduce) { .org__caixa.piscar { animation: none; outline-color: var(--fx-vermelho); } }
.nivel-hero__info .btn { margin-top: 12px; }
.nivel-hero__meds { display: grid; gap: 14px; }
.nivel-hero__med { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 14px; }
.nivel-hero__med b { display: block; font: 650 15px/1.2 var(--font-display); color: var(--ink); }
.nivel-hero__med small { font-size: 12px; color: var(--muted); }
.nivel-hero__pts { font: 800 28px/1 var(--font-display); letter-spacing: -.02em; color: var(--fx); }
.nivel-hero__med .pont-barra { grid-column: 1 / -1; }

/* =================================================================
   EQUIPAMENTOS — ativação e histórico
   ================================================================= */
.equip-busca { display: flex; align-items: flex-end; flex-wrap: wrap; gap: 12px; padding: 18px 20px; margin-bottom: 14px; }
.equip-busca label { display: grid; gap: 6px; flex: 1 1 320px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.equip-busca input[type=search] { width: 100%; padding: 13px 18px; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface);
  color: var(--ink); font: 500 20px/1.2 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; }
.equip-busca input[type=search]:focus { outline: 2px solid var(--lime); outline-offset: 1px; border-color: transparent; }
.equip-achados { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; margin-bottom: 16px; }
.equip-achados > .card + .card { margin-top: 0; }
.equip-card { display: grid; gap: 8px; padding: 16px 18px; }
.equip-card__sn { font: 650 20px/1.2 var(--font-mono); letter-spacing: .02em; color: var(--ink); text-decoration: none; }
.equip-vinculo { font-size: 13px; color: var(--ink-body); }
/* ---- caminho da remessa (partials/remessa-passos) e número de passo nos formulários ---- */
.rem-passos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0 0 16px; padding: 0; list-style: none; }
.rem-passo { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--surface); }
.rem-passo__n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--surface-2);
  border: 1px solid var(--border-strong); font: 700 13px/1 var(--font-display); color: var(--ink); }
.rem-passo__txt { display: grid; gap: 2px; min-width: 0; }
.rem-passo__txt b { font: 650 14px/1.3 var(--font-display); color: var(--ink); }
.rem-passo__txt small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.rem-passo--feito .rem-passo__n { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.rem-passo--agora { border-color: var(--lime-ink); box-shadow: inset 0 0 0 1px var(--lime-ink); }
.rem-passo--agora .rem-passo__n { background: var(--lime); border-color: var(--lime-ink); color: #16220b; }
.rem-passo--parou { border-color: var(--err-bd); background: var(--err-bg); }
.rem-passo--parou .rem-passo__n { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-fg); }
.rem-passo--pulado { opacity: .6; }
.passo-n { display: inline-grid; place-items: center; width: 20px; height: 20px; margin-right: 6px; border-radius: 50%; background: var(--ink);
  color: var(--surface); font: 700 11px/1 var(--font-display); letter-spacing: 0; vertical-align: 1px; }
.btn[hidden], tr[hidden] { display: none !important; }
.rem-proximo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; padding: 14px 16px; border-radius: var(--r-lg);
  border: 1px solid var(--border); background: var(--surface); }
.rem-proximo > div { flex: 1 1 320px; min-width: 0; }
.rem-proximo b.rem-proximo__titulo { display: block; font: 650 16px/1.35 var(--font-display); color: var(--ink); }
.rem-proximo small { color: var(--muted); font-size: 13px; }
.rem-proximo--vez { border-color: var(--lime-ink); background: var(--lime-soft); }
.rem-proximo--espera { border-color: var(--warn-bd); background: var(--warn-bg); }
.rem-proximo--espera b.rem-proximo__titulo, .rem-proximo--espera small { color: var(--warn-fg); }
@media (max-width: 760px) { .rem-passos { grid-template-columns: 1fr; } }
/* ---- topo da ficha do equipamento (partials/equip-topo): o essencial de relance e as ações do dia a dia ---- */
.equip-topo { margin-bottom: 14px; }
.equip-topo__dados { display: grid; grid-template-columns: 1fr 1fr 2fr 1.3fr; }
.equip-topo__bloco { display: grid; gap: 3px; align-content: start; min-width: 0; padding: 14px 18px; border-left: 1px solid var(--border); }
.equip-topo__bloco:first-child { border-left: 0; }
.equip-topo__bloco > span { font: 600 10.5px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.equip-topo__bloco > b { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; font: 650 15px/1.35 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.equip-topo__bloco > small { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.equip-topo__faixa { display: flex; align-items: center; gap: 10px; margin: 0 14px 10px; padding: 10px 12px; border-radius: var(--r);
  background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-fg); font-size: 13.5px; }
.equip-topo__faixa > span { flex: 1; min-width: 0; }
.equip-topo__faixa svg { flex: none; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.equip-topo__acoes { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 12px 18px; border-top: 1px solid var(--border); }
.equip-topo__form { display: contents; }
.equip-topo__porque { font-size: 12.5px; color: var(--muted); }
.equip-topo__porque a { margin-left: 4px; font-weight: 600; }
.btn .btn-ico { width: 16px; height: 16px; margin-right: 6px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
@media (max-width: 900px) {
  .equip-topo__dados { grid-template-columns: 1fr 1fr; }
  .equip-topo__bloco { border-left: 0; border-top: 1px solid var(--border); }
  .equip-topo__bloco:nth-child(-n+2) { border-top: 0; }
  .equip-topo__bloco--largo, .equip-topo__bloco:last-child { grid-column: 1 / -1; }
  .equip-topo__faixa { flex-wrap: wrap; }
}
/* árvore recolhida (só o escolhido + "Trocar") e campos escondidos dentro da grade */
.abr-arvore__resumo:has(.abr-arvore__trocar:not([hidden])) { position: relative; padding-right: 96px; }
.abr-arvore__trocar { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.abr-arvore__lista[hidden] { display: none; }
.form-grid > .field[hidden], .g12 > .field[hidden] { display: none; }
.equip-acoes { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.equip-acoes input[type=text] { flex: 1 1 160px; min-width: 140px; padding: 7px 10px; font-size: 13px; }
.equip-card .equip-acoes { justify-content: flex-start; }
/* a fila "Aguardando ativação" ocupa a largura toda; sem a largura mínima das tabelas do painel, o botão não some no estreito */
.equip-grade { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; gap: 16px; }
.equip-grade .tbl table { min-width: 0; }
.equip-grade td.acoes { width: 1%; }
.equip-hist .card__head .equip-acoes input[type=text] { width: 220px; flex: 0 1 220px; }
/* sinal on-line dos equipamentos (src/lib/sinal.js) */
.sinal { display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1.6 var(--font-mono); text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.sinal::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); }
.sinal small { font: 500 12px/1.4 var(--font-body); text-transform: none; letter-spacing: 0; color: var(--muted); }
.sinal--online { color: var(--ok-fg); }
.sinal--online::before { background: #3fae5a; box-shadow: 0 0 0 3px var(--ok-bg); }
.sinal--offline { color: var(--err-fg); }
.sinal--offline::before { background: var(--err-fg); box-shadow: 0 0 0 3px var(--err-bg); }
td .sinal { display: flex; margin-top: 4px; }
.kpi .kpi__sub { font-size: 12px; color: var(--muted); }
.sinal-grade { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; gap: 16px; margin-bottom: 16px; }
.sinal-grade > .card + .card { margin-top: 0; }
.sinal-grade .card__body > * + * { margin-top: 12px; }
.sinal-nova { margin-bottom: 16px; border-color: var(--ok-bd); }
.sinal-nova__chave { width: 100%; padding: 12px 14px; font-size: 14px; }
.sinal-codigo { margin: 8px 0 14px; padding: 14px 16px; overflow-x: auto; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); font: 12.5px/1.6 var(--font-mono); color: var(--ink); }
.sinal-respostas td:first-child { width: 1%; white-space: nowrap; }

/* =================================================================
   COMERCIAL — agenda, visitas (check-in, resumo em áudio, checkout), clientes e desempenho
   Tela da visita pensada para o celular; regras em src/lib/visitas.js.
   ================================================================= */
:root { --serie-1: #2a78d6; --vis-gravando: #d6453d; }
:root[data-tema="escuro"] { --serie-1: #3987e5; --vis-gravando: #ff6b62; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]):not([data-tema="escuro"]) { --serie-1: #3987e5; --vis-gravando: #ff6b62; }
}
.badge.err { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }
input[type=date], input[type=time] { width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); font: 400 14px/1.5 var(--font-body); color: var(--ink); color-scheme: light dark; }
.vis-alerta { color: var(--err-fg); font-weight: 600; }
.vis-texto { white-space: pre-line; overflow-wrap: anywhere; }
.vis-audio { width: 100%; max-width: 520px; height: 40px; display: block; }

/* atalhos do módulo no celular (o menu lateral some abaixo de 860px) */
.com-nav { display: none; }
@media (max-width: 860px) {
  .com-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 4px; margin: -4px 0 16px; padding: 4px;
    border: 1px solid var(--border); border-radius: 14px; background: var(--surface); }
  .com-nav a { display: grid; justify-items: center; gap: 2px; padding: 7px 4px; border-radius: 10px; text-decoration: none;
    font: 600 11.5px/1.2 var(--font-display); color: var(--muted); }
  .com-nav a.on { background: var(--sel-bg); color: var(--sel-fg); }
  .com-nav svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
}

/* cliente: campo da localização */
.cli-ponto { display: grid; gap: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink); align-content: start; }
.cli-ponto .hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }
.cli-ponto__linha { display: flex; gap: 8px; align-items: center; }
.cli-ponto__linha input { flex: 1; min-width: 0; }
.cli-ponto__linha .btn { flex: none; }
@media (max-width: 560px) { .cli-ponto__linha { flex-direction: column; align-items: stretch; } }

/* histórico de visitas (aba do cliente e lateral da visita) */
.vis-hist { list-style: none; display: grid; gap: 0; }
.vis-hist__item { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--border); }
.vis-hist__item:first-child { border-top: 0; padding-top: 0; }
.vis-hist__topo { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.vis-hist__topo a { font: 600 14px/1.3 var(--font-display); color: var(--ink); text-decoration: none; }
.vis-hist__topo a:hover { text-decoration: underline; }
.vis-hist__passo { font-size: 13px; }
.vis-res { justify-self: start; font: 600 11.5px/1.6 var(--font-mono); text-transform: uppercase; letter-spacing: .05em; padding: 1px 9px;
  border-radius: 999px; border: 1px solid var(--border); color: var(--muted); }
.vis-res--positivo { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.vis-res--negativo { background: var(--err-bg); color: var(--err-fg); border-color: var(--err-bd); }

/* tela da visita */
.vis-grade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); gap: 16px; align-items: start; }
.vis-principal { display: grid; gap: 16px; min-width: 0; }
.vis-principal > .card + .card, .vis-lado > .card + .card { margin-top: 0; }
.vis-lado { display: grid; gap: 16px; position: sticky; top: 78px; }
@media (max-width: 1100px) { .vis-grade { grid-template-columns: minmax(0, 1fr); } .vis-lado { position: static; } }
.vis-cab { padding: 18px 20px; display: grid; gap: 10px; }
.vis-cab__selos { display: flex; gap: 6px; flex-wrap: wrap; }
.vis-cab__cliente { font-size: 22px; letter-spacing: -.015em; }
.vis-cab__cliente a { text-decoration: none; }
.vis-cab__cliente a:hover { text-decoration: underline; }
.vis-dados { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 20px; }
.vis-dados > div { display: grid; gap: 2px; align-content: start; min-width: 0; }
.vis-dados dt { font: 600 10.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .09em; color: var(--muted); }
.vis-dados dd { font-size: 14px; color: var(--ink); overflow-wrap: anywhere; }
.vis-dados__largo { grid-column: 1 / -1; }
.vis-rota { margin-left: 6px; vertical-align: middle; }
.vis-passos { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.vis-passos li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); min-width: 0; }
.vis-passos li b { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; font: 700 13px/1 var(--font-display);
  border: 1.5px solid var(--border-strong); }
.vis-passos li span { display: grid; min-width: 0; font: 650 14px/1.25 var(--font-display); color: inherit; }
.vis-passos li small { font: 400 12px/1.3 var(--font-body); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vis-passos li.atual { border-color: var(--lime-ink); color: var(--ink); box-shadow: inset 0 0 0 1px var(--lime-ink); }
.vis-passos li.atual b { background: var(--lime); border-color: transparent; color: #16220b; }
.vis-passos li.feito { color: var(--ink); }
.vis-passos li.feito b { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
@media (max-width: 560px) { .vis-passos li { flex-direction: column; align-items: flex-start; gap: 6px; padding: 9px 10px; } }
.vis-etapa { scroll-margin-top: 84px; }
.vis-botao { min-height: 52px; padding: 14px 26px; font-size: 16px; }
@media (max-width: 560px) { .vis-botao { width: 100%; } }
.vis-geo { display: grid; gap: 8px; justify-items: start; }
.vis-geo__status, .gravador__status { font-size: 13px; color: var(--muted); min-height: 1em; }
.vis-geo__status:empty, .gravador__status:empty { display: none; }
.vis-motivos { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.vis-motivo { display: contents; }
.vis-motivo > summary { list-style: none; cursor: pointer; }
.vis-motivo > summary::-webkit-details-marker { display: none; }
.vis-motivo[open] > summary { background: var(--sel-bg); color: var(--sel-fg); border-color: transparent; }
.vis-motivo[open] > form { order: 10; flex-basis: 100%; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.vis-apagar { color: var(--danger); margin-left: auto; }
.vis-relogio { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--warn-bg);
  border: 1px solid var(--warn-bd); color: var(--warn-fg); font-size: 14px; }
.vis-relogio b { color: inherit; }
.vis-relogio__ponto { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--warn-fg); animation: vis-pulso 1.6s ease-in-out infinite; }
@keyframes vis-pulso { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 45%, transparent); } 50% { box-shadow: 0 0 0 7px transparent; } }
.vis-retorno { display: grid; gap: 10px; }
.vis-fora > summary { cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.vis-fora[open] > summary { margin-bottom: 10px; color: var(--ink); }
.vis-fora[open] { padding: 12px 14px; border: 1px solid var(--err-bd); border-radius: 12px; background: var(--err-bg); }
.vis-form-rotulo { display: block; margin-bottom: 6px; font-size: 13.5px; font-weight: 500; color: var(--ink); }
.vis-form-novo { align-self: end; padding-bottom: 2px; }
.vis-tipos { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.vis-ouvir { display: grid; gap: 6px; }
/* cor da fase do funil: selo e bolinha (visita, clientes) e a borda dos selects de fase (studio.js, select[data-cor-viva] → --fase) */
.fase-selo { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  color: var(--ink); background: color-mix(in srgb, var(--fase) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--fase) 45%, transparent); }
.fase-selo i, .fase-ponto { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--fase); flex: none; }
.fase-ponto { margin-right: 6px; vertical-align: 1px; }
select[data-cor-viva] { border-left: 6px solid var(--fase, var(--border-strong)); }

/* ---- funis de venda (Comercial → Funis de venda) ---- */
/* o desenho do funil: uma barra por fase, estreitando para baixo (partials/funil-etapas) */
.funil-etapas { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.funil-etapas li { width: var(--largura, 100%); max-width: 100%; margin: 0 auto; }
.funil-etapas__barra { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; padding: 4px 12px;
  border-radius: 8px; color: var(--ink); font-size: 13px; text-decoration: none;
  background: color-mix(in srgb, var(--fase, var(--lime-ink)) 18%, var(--surface)); border: 1px solid color-mix(in srgb, var(--fase, var(--lime-ink)) 50%, transparent);
  box-shadow: inset 4px 0 0 var(--fase, var(--lime-ink)); }
a.funil-etapas__barra:hover { border-color: var(--fase, var(--lime-ink)); }
.funil-etapas__nome { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funil-etapas__n { display: inline-flex; align-items: baseline; gap: 5px; flex: none; font-family: var(--font-mono); }
.funil-etapas__pula { color: var(--muted); font-size: 11px; font-weight: 400; }
.cad-kpis .kpi b.kpi__texto { font-size: 17px; line-height: 1.25; overflow-wrap: anywhere; }
.funil-padrao { margin-top: 14px; max-width: 760px; }
.funil-etapas--grande { gap: 6px; max-width: 720px; margin: 0 auto; }
.funil-etapas--grande .funil-etapas__barra { min-height: 44px; padding: 8px 16px; font-size: 15px; }
.funil-descricao { margin: 8px 0 0; }
.funil-pilulas { display: flex; flex-wrap: wrap; gap: 6px; }
.funil-pilula { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--ink); font-size: 12.5px; text-decoration: none; }
.funil-pilula b { font-family: var(--font-mono); font-size: 11.5px; }
.funil-pilula i { width: 8px; height: 8px; border-radius: 50%; background: var(--fase, var(--muted)); flex: none; }
a.funil-pilula:hover { border-color: var(--fase, var(--lime-ink)); }
/* as fases no formulário: linhas numeradas com subir, descer e tirar (studio.js, [data-funil-fases]) */
.funil-fases__ajuda { margin: -6px 0 12px; }
.funil-fases { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; max-width: 1000px; counter-reset: fase; }
/* grade fixa: número · nome · cor · obrigatória/pode pular · clientes · botões — os nomes ficam alinhados com ou sem clientes */
.funil-fase { display: grid; grid-template-columns: 28px minmax(0, 1fr) 118px 132px 108px auto; align-items: center; gap: 8px; counter-increment: fase; }
.funil-fase::before { content: counter(fase); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  border: 2px solid var(--fase, var(--border)); background: color-mix(in srgb, var(--fase, var(--muted)) 18%, var(--surface)); color: var(--ink);
  font: 600 12px/1 var(--font-mono); }
.funil-fase input[type="text"], .funil-fase select { width: 100%; min-width: 0; }
.funil-fase__qtd { display: flex; }
.funil-fase__botoes { display: inline-flex; gap: 2px; flex: none; }
.funil-fase__botoes .btn { min-width: 34px; padding-inline: 8px; }
[data-fase-mais][hidden] { display: none; }

/* trilha do funil em Clientes (partials/funil-trilha): funis em pílulas e as fases em setas encadeadas, na cor de cada uma */
.funil-trilha { margin: 0 0 16px; }
.funil-trilha__topo { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 10px; }
.funil-trilha__rotulo { margin-right: 6px; font: 600 10.5px/1.4 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.funil-trilha__funil { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); font-size: 13px; font-weight: 600; text-decoration: none; }
.funil-trilha__funil:hover { color: var(--ink); }
.funil-trilha__funil small { font-weight: 500; font-size: 11px; opacity: .8; }
.funil-trilha__funil span { font: 600 11px/1 var(--font-mono); opacity: .75; }
.funil-trilha__funil.on { background: var(--sel-bg); border-color: transparent; color: var(--sel-fg); }
.funil-trilha__fases { list-style: none; margin: 0; padding: 0 0 4px; display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
.funil-trilha__fases li { flex: 1 1 0; min-width: 160px; scroll-snap-align: start; }
.funil-trilha__fases li + li { margin-left: -8px; }
.funil-trilha__fases a { display: flex; align-items: center; gap: 10px; height: 56px; padding: 0 30px 0 32px; color: var(--ink); text-decoration: none;
  background: color-mix(in srgb, var(--fase) 13%, var(--surface)); box-shadow: inset 0 -3px 0 color-mix(in srgb, var(--fase) 70%, transparent);
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%, 18px 50%); transition: background .15s; }
.funil-trilha__fases li:first-child a { padding-left: 16px; border-radius: 12px 0 0 12px;
  clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 50%, calc(100% - 18px) 100%, 0 100%); }
.funil-trilha__fases li:last-child a { padding-right: 18px; border-radius: 0 12px 12px 0; clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%, 18px 50%); }
.funil-trilha__fases li:only-child a { clip-path: none; border-radius: 12px; }
.funil-trilha__fases a:hover { background: color-mix(in srgb, var(--fase) 24%, var(--surface)); }
.funil-trilha__fases a:focus-visible { outline: none; background: color-mix(in srgb, var(--fase) 30%, var(--surface)); }
.funil-trilha__n { flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--fase);
  background: var(--surface); font: 700 12px/1 var(--font-mono); color: var(--ink); }
.funil-trilha__nome { display: grid; min-width: 0; font-size: 13.5px; font-weight: 600; line-height: 1.2; }
.funil-trilha__nome, .funil-trilha__nome small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funil-trilha__nome small { font-size: 11px; font-weight: 400; color: var(--muted); }
.funil-trilha__qtd { margin-left: auto; font: 700 16px/1 var(--font-mono); }
.funil-trilha__fases li.vazia .funil-trilha__qtd, .funil-trilha__fases li.vazia .funil-trilha__nome { color: var(--muted); }
.funil-trilha__fases li.on a { background: color-mix(in srgb, var(--fase) 36%, var(--surface)); box-shadow: inset 0 -4px 0 var(--fase); }
.funil-trilha__fases li.on .funil-trilha__n { background: var(--fase); border-color: var(--fase); color: #fff; }
@media (max-width: 560px) {
  .funil-trilha__fases li { min-width: 210px; }
  .funil-trilha__fases a { height: 52px; gap: 8px; }
}
@media (max-width: 560px) {
  .funil-etapas li { width: 100%; }
  .funil-fase { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr); }
  .funil-fase input[type="text"] { grid-column: 2 / 4; }
  .funil-fase select:first-of-type { grid-column: 2; }
  .funil-fase__qtd { grid-column: 2; }
  .funil-fase__botoes { grid-column: 3; justify-self: end; }
}

/* gravador do resumo */
.gravador { display: grid; gap: 12px; }
/* o painel não tem [hidden] global: sem isto o display acima mostraria a prévia e o gravador escondidos */
.gravador[hidden], .gravador__previa[hidden] { display: none; }
.gravador__painel { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px; border-radius: 14px;
  border: 1px dashed var(--border-strong); background: var(--surface-2); }
.gravador__rec { display: inline-flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 22px 10px 12px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); font: 650 16px/1 var(--font-display); cursor: pointer; }
.gravador__icone { width: 34px; height: 34px; border-radius: 50%; background: var(--vis-gravando); box-shadow: inset 0 0 0 9px var(--surface); border: 2px solid var(--vis-gravando); }
.gravador.gravando .gravador__rec { border-color: var(--vis-gravando); }
.gravador.gravando .gravador__icone { border-radius: 9px; box-shadow: inset 0 0 0 7px var(--surface); animation: vis-pulso 1.6s ease-in-out infinite; color: var(--vis-gravando); }
.gravador__tempo { font: 600 22px/1 var(--font-mono); color: var(--ink); letter-spacing: .03em; min-width: 72px; }
.gravador.gravando .gravador__tempo { color: var(--vis-gravando); }
.gravador__nivel { flex: 1 1 120px; height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.gravador__nivel i { display: block; height: 100%; width: 0; background: var(--vis-gravando); border-radius: inherit; transition: width .08s linear; }
.gravador__previa { display: grid; gap: 10px; }
.gravador-arquivo { display: grid; gap: 8px; }
.gravador-arquivo--alt { padding-top: 10px; border-top: 1px solid var(--border); }
.gravador-arquivo--alt label.field > span { font-weight: 400; color: var(--muted); font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .vis-relogio__ponto, .gravador.gravando .gravador__icone { animation: none; } }

/* agenda */
.agenda-andamento { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; padding: 13px 16px; border-radius: 12px;
  background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-fg); text-decoration: none; font-size: 14px; }
.agenda-andamento b { color: inherit; }
.agenda-andamento em { margin-left: auto; font-style: normal; font-weight: 700; white-space: nowrap; }
.agenda-barra { display: flex; align-items: center; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 14px; }
.agenda-nav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.agenda-nav .btn-icon { width: 34px; height: 34px; padding: 0; font-size: 18px; border-radius: 50%; }
.agenda-nav__rotulo { font-size: 16px; margin-left: 8px; letter-spacing: -.01em; }
.agenda-vendedor { margin-left: auto; }
.agenda-vendedor select, .desemp-periodo + .agenda-nav + .agenda-vendedor select { width: auto; min-width: 220px; padding: 8px 12px; }
@media (max-width: 560px) { .agenda-vendedor { margin-left: 0; width: 100%; } .agenda-vendedor select { width: 100%; } .agenda-nav__rotulo { flex-basis: 100%; margin: 4px 0 0; } }
.agenda-kpi-meta b small { font-size: 14px; color: var(--muted); font-weight: 500; letter-spacing: 0; }
.agenda-meta { display: block; height: 6px; margin-top: 6px; border-radius: 999px; background: var(--border); overflow: hidden; min-width: 80px; }
.agenda-meta i { display: block; height: 100%; background: var(--lime-ink); border-radius: inherit; }
.agenda-kpi-alerta { color: var(--err-fg) !important; }
.agenda-semana { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; align-items: stretch; }
.agenda-dia { display: flex; flex-direction: column; min-width: 0; min-height: 220px; border: 1px solid var(--border); border-radius: 14px;
  background: var(--surface); scroll-margin-top: 84px; }
.agenda-dia.passado { background: var(--surface-2); }
.agenda-dia.hoje { border-color: var(--lime-ink); box-shadow: inset 0 0 0 1px var(--lime-ink); }
.agenda-dia__cab { display: flex; align-items: baseline; gap: 6px; padding: 10px 10px 8px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.agenda-dia__cab b { font: 700 13px/1.2 var(--font-display); color: var(--ink); text-transform: uppercase; letter-spacing: .04em; }
.agenda-dia__cab span { font: 500 12.5px/1.2 var(--font-mono); color: var(--muted); }
.agenda-dia__cab em { font: 700 10.5px/1.5 var(--font-mono); text-transform: uppercase; font-style: normal; padding: 0 6px; border-radius: 999px;
  background: var(--lime); color: #16220b; }
.agenda-dia__cab small { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.agenda-dia__lista { display: grid; gap: 6px; padding: 8px; align-content: start; flex: 1; }
.agenda-dia__livre { font-size: 12.5px; color: var(--muted); padding: 4px 2px; }
.agenda-dia__nova { display: block; padding: 8px; text-align: center; font: 600 12.5px/1.2 var(--font-display); color: var(--muted);
  text-decoration: none; border-top: 1px dashed var(--border); border-radius: 0 0 14px 14px; }
.agenda-dia__nova:hover { color: var(--ink); background: var(--surface-2); }
.agenda-vis { display: grid; gap: 3px; padding: 8px 9px; border-radius: 10px; border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  background: var(--surface); text-decoration: none; color: var(--ink-body); min-width: 0; transition: transform .12s, box-shadow .12s; }
.agenda-vis:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.agenda-vis__hora { font: 600 11.5px/1.3 var(--font-mono); color: var(--muted); }
.agenda-vis__cliente { font: 650 13.5px/1.25 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.agenda-vis__onde { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-vis__pe { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.agenda-vis__pe .badge { font-size: 10px; padding: 1px 7px; }
.agenda-vis__pe small { font-size: 11.5px; color: var(--muted); }
.agenda-vis.st--concluida { border-left-color: var(--ok-fg); }
.agenda-vis.st--em_andamento { border-left-color: var(--warn-fg); background: var(--warn-bg); }
.agenda-vis.st--atrasada, .agenda-vis.st--nao_realizada { border-left-color: var(--err-fg); }
.agenda-vis.st--cancelada { opacity: .6; }
.agenda-vis.st--cancelada .agenda-vis__cliente { text-decoration: line-through; }
@media (max-width: 1000px) {
  .agenda-semana { grid-template-columns: minmax(0, 1fr); }
  .agenda-dia { min-height: 0; }
  .agenda-dia__lista { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
  .agenda-dia.passado:not(.hoje) .agenda-dia__livre { display: none; }
}
.agenda-grade { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.agenda-grade > .card + .card { margin-top: 0; }
@media (max-width: 900px) { .agenda-grade { grid-template-columns: minmax(0, 1fr); } }
.agenda-lista { list-style: none; }
.agenda-lista li { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 12px; align-items: center;
  padding: 11px 20px; border-top: 1px solid var(--border); }
.agenda-lista li:first-child { border-top: 0; }
.agenda-lista li > a:first-child, .agenda-lista li > b:first-child { grid-column: 1; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.agenda-lista li > a:first-child:hover { text-decoration: underline; }
.agenda-lista li small { grid-column: 1; font-size: 12.5px; color: var(--muted); }
.agenda-lista li .btn { grid-column: 2; grid-row: 1 / span 2; }

/* desempenho */
.desemp-periodo .seg__btn { width: auto; padding: 0 16px; font: 600 13.5px/1 var(--font-display); text-decoration: none; }
.desemp-tabela td { vertical-align: top; }
.desemp-tabela .agenda-meta { width: 110px; }
.serie { display: grid; gap: 6px; }
.serie__plot { position: relative; height: 190px; display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px;
  align-items: end; border-bottom: 1px solid var(--border-strong);
  background-image: linear-gradient(to top, var(--border) 1px, transparent 1px); background-size: 100% 25%; }
.serie__col { position: relative; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; outline: none; cursor: default; }
.serie__col:hover, .serie__col:focus-visible { background: var(--hover); }
.serie__col:focus-visible { box-shadow: inset 0 0 0 2px var(--lime-ink); border-radius: 6px 6px 0 0; }
.serie__barra { display: block; width: min(38px, 62%); min-height: 2px; background: var(--serie-1); border-radius: 4px 4px 0 0; }
.serie__valor { font: 650 13px/1.2 var(--font-display); color: var(--ink); margin-bottom: 4px; }
.serie__dica { position: absolute; bottom: calc(100% - 8px); left: 50%; transform: translate(-50%, -4px); z-index: 3; padding: 7px 10px; border-radius: 9px;
  background: var(--navy); color: #fff; font-size: 12px; line-height: 1.35; white-space: nowrap; text-align: center; box-shadow: var(--shadow-sm);
  opacity: 0; pointer-events: none; transition: opacity .12s; }
.serie__dica b { font-size: 14px; color: #fff; }
.serie__col:hover .serie__dica, .serie__col:focus-visible .serie__dica { opacity: 1; }
.serie__col:first-child .serie__dica { left: 0; transform: translate(0, -4px); }
.serie__col:last-child .serie__dica { left: auto; right: 0; transform: translate(0, -4px); }
.serie__meta { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed var(--muted); z-index: 2; pointer-events: none; }
.serie__meta span { position: absolute; right: 0; bottom: 3px; font: 600 11px/1 var(--font-mono); color: var(--muted); background: var(--surface); padding: 1px 4px; }
.serie__eixo { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 2px; text-align: center; font: 500 11.5px/1.2 var(--font-mono); color: var(--muted); }
.serie__eixo .atual { color: var(--ink); font-weight: 700; }
.serie__tabela summary { cursor: pointer; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.serie__tabela table { margin-top: 8px; border-collapse: collapse; font-size: 13px; }
.serie__tabela th, .serie__tabela td { padding: 4px 14px 4px 0; text-align: left; border-bottom: 1px solid var(--border); }

/* gravador: ondinhas que sobem com a voz, selo "captando áudio", microfone escolhido e aviso de silêncio (studio.js) */
.gravador__onda { display: inline-flex; align-items: center; gap: 4px; height: 38px; padding: 0 2px; flex: 0 0 auto; }
.gravador__onda i { display: block; width: 5px; height: 100%; border-radius: 3px; background: var(--border-strong);
  transform: scaleY(.12); transform-origin: center; transition: transform .07s linear, background .2s; }
.gravador.gravando .gravador__onda i { background: var(--vis-gravando); }
.gravador.gravando.gravador--mudo .gravador__onda i { background: var(--muted); }
.gravador__captando { display: inline-flex; align-items: center; gap: 7px; padding: 4px 11px; border-radius: 999px;
  font: 600 11.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .05em;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.gravador__captando::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.gravador__captando.on { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.gravador__captando.on::before { background: currentColor; animation: vis-pulso 1.2s ease-in-out infinite; }
.gravador__captando[hidden], .gravador__mic[hidden] { display: none; }
.gravador__mic { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.gravador__mic select { width: auto; max-width: 100%; min-width: 220px; padding: 7px 10px; font-size: 13px; }
.gravador--mudo .gravador__status { color: var(--err-fg); font-weight: 600; }
.gravador--mudo .gravador__painel { border-color: var(--err-bd); }
@media (prefers-reduced-motion: reduce) { .gravador__onda i { transition: none; } .gravador__captando.on::before { animation: none; } }

/* MAPA (Comercial): clientes e check-ins no Leaflet; as cores dos pontos valem nos dois temas (o mapa é sempre claro) */
:root { --mapa-cliente: #2563eb; --mapa-checkin: #16a34a; --mapa-checkout: #d97706; --mapa-fora: #dc2626; }
.mapa-filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.mapa-filtros select { width: auto; min-width: 180px; max-width: 100%; padding: 8px 12px; }
.mapa-card { overflow: hidden; }
.mapa-camadas { display: flex; align-items: center; gap: 8px 18px; flex-wrap: wrap; }
.mapa-camada { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--ink); cursor: pointer; }
.mapa-camada input { width: auto; margin: 0; }
.mapa-camada span { font: 500 11.5px var(--font-mono); color: var(--muted); }
.mapa-legenda { display: inline-flex; align-items: center; gap: 7px; margin-left: auto; font-size: 12px; color: var(--muted); }
.mapa-cor { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border-strong); }
.mapa-cor--cliente { background: var(--mapa-cliente); }
.mapa-cor--checkin { background: var(--mapa-checkin); }
.mapa-cor--checkout { background: var(--mapa-checkout); }
.mapa-cor--fora { background: var(--mapa-fora); }
.mapa { height: clamp(380px, 66vh, 760px); background: var(--surface-2); z-index: 0; }
.mapa[hidden], .mapa-vazio[hidden] { display: none; }
.mapa-vazio { margin: 0; padding: 14px 18px; font-size: 13.5px; color: var(--muted); border-top: 1px solid var(--border); }
.mapa-rodape { margin-top: 8px; }
.mapa-popup { display: grid; gap: 3px; min-width: 190px; font: 13px/1.4 var(--font-body); color: #1d2433; }
.mapa-popup b { font-size: 14px; }
.mapa-popup small { color: #5b6475; }
.mapa-popup .fora { color: #b42318; font-weight: 600; }
.mapa-popup a { margin-top: 4px; font-weight: 600; }
@media (max-width: 700px) { .mapa-legenda { margin-left: 0; } .mapa-filtros select { min-width: 0; flex: 1 1 160px; } }

/* VISITA: endereço do cliente em destaque, mapa pequeno do ponto e o botão "Como chegar" */
.vis-onde { display: grid; gap: 14px; padding: 18px 20px; }
.vis-onde__texto { display: grid; gap: 4px; }
.vis-onde__texto p { margin: 0; }
.vis-onde__rotulo { font: 600 11.5px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.vis-onde__rua { font-size: 19px; font-weight: 650; line-height: 1.3; color: var(--ink); }
.vis-onde__local { font-size: 14.5px; color: var(--ink-body); }
.vis-mini-mapa { height: 230px; border-radius: 12px; border: 1px solid var(--border); overflow: hidden; background: var(--surface-2); z-index: 0; }
.vis-mini-mapa[hidden] { display: none; }
.vis-onde__acoes { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.vis-onde__rota { min-height: 48px; padding: 12px 24px; font-size: 16px; }
@media (max-width: 560px) { .vis-onde__rota { width: 100%; justify-content: center; } .vis-mini-mapa { height: 200px; } }

/* PINOS dos mapas (studio.js pinoMapa): cor por tipo, borda branca e sombra; as ruas ficam mais apagadas para os pinos saltarem */
.mapa .leaflet-tile-pane, .vis-mini-mapa .leaflet-tile-pane { filter: saturate(.3) brightness(1.04); }
.mapa-pino { background: none; border: 0; }
.mapa-pino svg { display: block; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 2px 3px rgba(15, 23, 42, .45));
  transition: transform .12s ease; transform-origin: 50% 95%; }
.mapa-pino--checkin svg, .mapa-pino--checkout svg, .mapa-pino--fora svg { transform-origin: 50% 50%; }
.mapa-pino__corpo { fill: var(--pino); stroke: #fff; stroke-width: 2.5; }
.mapa-pino__icone { fill: none; stroke: var(--pino); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mapa-pino--cliente { --pino: var(--mapa-cliente); }
.mapa-pino--checkin { --pino: var(--mapa-checkin); }
.mapa-pino--checkout { --pino: var(--mapa-checkout); }
.mapa-pino--fora { --pino: var(--mapa-fora); }
.mapa-pino--fora::before { content: ''; position: absolute; inset: -7px; border-radius: 50%; background: rgba(220, 38, 38, .25); }
.mapa-pino:hover svg, .mapa-pino:focus-visible svg, .mapa-pino.ativo svg { transform: scale(1.25); }
.mapa-pino.ativo svg { filter: drop-shadow(0 3px 7px rgba(15, 23, 42, .6)); }
.mapa-etiqueta { font: 650 12.5px/1.3 var(--font-body); color: #1d2433; }
/* legenda com as mesmas formas dos pinos */
.mapa-cor { width: 14px; height: 14px; }
.mapa-cor--cliente { border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.mapa-cor--fora { box-shadow: 0 0 0 1px var(--border-strong), 0 0 0 4px rgba(220, 38, 38, .25); }
@media (prefers-reduced-motion: reduce) { .mapa-pino svg { transition: none; } }
/* visita com a foto do vendedor: a foto num anel da cor do tipo e o símbolo num selo no canto */
.mapa-pino--foto { transition: transform .12s ease; }
.mapa-pino__foto { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; background: var(--pino);
  border: 3px solid var(--pino); box-shadow: 0 0 0 2px #fff, 0 3px 7px rgba(15, 23, 42, .45); }
.mapa-pino__foto img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.mapa-pino__selo { position: absolute; right: -5px; bottom: -5px; width: 20px; height: 20px; }
.mapa-pino--foto .mapa-pino__selo svg { filter: none; transform: none; }
.mapa-pino--foto:hover, .mapa-pino--foto:focus-visible, .mapa-pino--foto.ativo { transform: scale(1.18); }
.mapa-pino--foto.mapa-pino--fora::before { inset: -8px; }
.mapa-popup__cab { display: flex; align-items: center; gap: 8px; }
.mapa-popup__foto { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex: none; }
/* botões de zoom maiores (Aproximar / Afastar) e "Ver tudo" */
.mapa .leaflet-control-zoom a, .vis-mini-mapa .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 38px; font-size: 22px; }
.mapa-ver-tudo { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; background: #fff; color: #1d2433; cursor: pointer; }
.mapa-ver-tudo:hover { background: #f4f4f4; }
.mapa-ver-tudo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* USUÁRIOS: foto (ou iniciais) ao lado do nome na lista (a das fichas usa .user-btn__av--foto, lá do topo) */
.usuario-cel { display: flex; align-items: center; gap: 10px; min-width: 0; }

/* MAPA: linha do tempo (dia a dia, semana a semana, mês a mês) com ▶, deslizante e colunas por período */
.mapa-tempo-escolha { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mapa-tempo { display: grid; gap: 10px; padding: 14px 18px 16px; border-top: 1px solid var(--border); }
.mapa-tempo[hidden] { display: none; }
.mapa-tempo__controles { display: flex; align-items: center; gap: 14px; }
.mapa-tempo__play { flex: none; min-width: 132px; }
.mapa-tempo__deslizante { flex: 1 1 auto; width: 100%; accent-color: var(--mapa-checkin); }
.mapa-tempo__info { display: flex; align-items: center; gap: 6px 16px; flex-wrap: wrap; }
.mapa-tempo__info b { font-size: 16px; color: var(--ink); }
.mapa-tempo__acumular { margin-left: auto; font-weight: 500; }
.mapa-tempo__barras { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.mapa-tempo__col { flex: 1 1 0; min-width: 3px; height: 100%; display: flex; align-items: flex-end; padding: 0; border: 0; background: none; cursor: pointer; }
.mapa-tempo__col i { display: block; width: 100%; min-height: 3px; border-radius: 3px 3px 0 0; background: var(--border-strong); transition: background .15s; }
.mapa-tempo__col:hover i, .mapa-tempo__col:focus-visible i { background: var(--muted); }
.mapa-tempo__col.antes i { background: var(--mapa-checkin); opacity: .45; }
.mapa-tempo__col.on i { background: var(--mapa-checkin); opacity: 1; }
.mapa-tempo__eixo { display: flex; justify-content: space-between; font: 500 11.5px/1.2 var(--font-mono); color: var(--muted); }
@media (max-width: 560px) { .mapa-tempo__controles { flex-wrap: wrap; } .mapa-tempo__play { width: 100%; } .mapa-tempo__acumular { margin-left: 0; } }
/* os botões "Dia a dia / Semana a semana / Mês a mês" não encolhem nem quebram a linha no topo */
.mapa-tempo-escolha { flex: none; }
.mapa-tempo-escolha .seg { flex: none; }
/* .seg__btn nasce com 42px (botão de ícone): com texto, largura livre como o seletor de período do Desempenho */
.mapa-tempo-escolha .seg__btn { width: auto; padding: 0 14px; font: 600 13.5px/1 var(--font-display); text-decoration: none; white-space: nowrap; }
@media (max-width: 560px) { .mapa-tempo-escolha, .mapa-tempo-escolha .seg { flex: 1 1 100%; } .mapa-tempo-escolha .seg__btn { flex: 1 1 0; text-align: center; } }

/* =================================================================
   VERSÃO CELULAR (protótipo: Visita mobile — partials/m-top e m-bottom)
   Layout próprio para o celular: barra do topo com voltar, conteúdo em cartões com botões grandes
   e as abas do Comercial fixas no rodapé. Só tokens do tema: claro e escuro funcionam.
   ================================================================= */
body.m { min-height: 100vh; min-height: 100dvh; background: var(--bg); }
.m-barra { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 4px; min-height: 60px;
  padding: calc(6px + env(safe-area-inset-top)) 6px 6px; background: var(--surface); border-bottom: 1px solid var(--border); }
.m-barra__btn { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; color: var(--ink); text-decoration: none; }
.m-barra__btn:active { background: var(--surface-2); }
.m-barra__btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-barra__titulo { display: grid; flex: 1; min-width: 0; padding: 0 2px; }
.m-barra__titulo b { font: 650 16.5px/1.25 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-barra__titulo small { font-size: 12.5px; line-height: 1.3; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-conteudo { display: grid; gap: 12px; width: 100%; max-width: 640px; margin: 0 auto;
  padding: 12px 12px calc(96px + env(safe-area-inset-bottom)); }
.m-conteudo > .flash { margin: 0; }
.m-card { display: grid; gap: 12px; min-width: 0; padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.m-card__cab { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.m-card__titulo { font: 650 18px/1.3 var(--font-display); color: var(--ink); }
.m-card p { margin: 0; }
.m-rotulo { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
/* cabeçalho da visita */
.m-visita__selos { display: flex; flex-wrap: wrap; gap: 6px; }
.m-visita__cliente { font: 700 24px/1.2 var(--font-display); letter-spacing: -.015em; color: var(--ink); overflow-wrap: anywhere; }
.m-visita__quando { font: 600 15.5px/1.35 var(--font-display); color: var(--ink); }
.m-visita__contato { font-size: 14.5px; color: var(--ink-body); }
.m-visita__pauta { display: grid; gap: 2px; font-size: 14.5px; }
.m-visita__vendedor { padding-top: 10px; border-top: 1px solid var(--border); }
/* etapas */
.m-passos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.m-passos li { display: grid; justify-items: center; gap: 5px; padding: 10px 4px; border-radius: 16px; text-align: center;
  background: var(--surface); border: 1px solid var(--border); font: 600 13px/1.2 var(--font-display); color: var(--muted); }
.m-passos li span { display: grid; gap: 2px; }
.m-passos small { font: 500 11.5px/1.2 var(--font-body); color: var(--muted); }
.m-passos b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); font-size: 14px; color: var(--muted); }
.m-passos .feito { color: var(--ink); }
.m-passos .feito b { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.m-passos .atual { color: var(--ink); border-color: var(--lime-ink); box-shadow: inset 0 0 0 1px var(--lime-ink); }
.m-passos .atual b { background: var(--sel-bg); border-color: transparent; color: var(--sel-fg); }
.m-relogio { margin: 0; }
/* endereço */
.m-onde { gap: 8px; }
.m-onde__rua { font: 650 19px/1.3 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.m-onde__local { font-size: 14.5px; color: var(--ink-body); }
.m-onde__mapa { height: 200px; margin-top: 4px; }
/* botões grandes, feitos para o dedo */
.m-botoes { display: grid; gap: 8px; margin-top: 4px; }
.m-botoes--dois { grid-template-columns: 1fr 1fr; }
.m-botao { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 52px; padding: 10px 14px;
  font-size: 16px; border-radius: 14px; text-align: center; text-decoration: none; }
.m-botao svg { width: 21px; height: 21px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-botao--grande { min-height: 60px; font-size: 18px; }
.m-botoes--dois .m-botao { gap: 7px; padding: 10px 8px; font-size: 15.5px; white-space: nowrap; }
.m-card .vis-geo { display: grid; gap: 8px; }
.m-card .vis-geo__status { text-align: center; }
/* campos com 16px: o iPhone não dá zoom ao tocar */
.m-card input[type=text], .m-card input[type=date], .m-card input[type=time], .m-card textarea, .m-card select { font-size: 16px; }
/* "como foi": opções grandes, uma embaixo da outra */
.m-resultado { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.m-resultado legend { margin-bottom: 6px; }
.m-resultado__opcao { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border-radius: 14px;
  border: 1px solid var(--border-strong); background: var(--surface); cursor: pointer; }
.m-resultado__opcao input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--lime-ink); }
.m-resultado__opcao span { display: grid; gap: 1px; }
.m-resultado__opcao b { font: 650 15.5px/1.25 var(--font-display); color: var(--ink); }
.m-resultado__opcao small { font-size: 12.5px; color: var(--muted); }
.m-resultado__opcao:has(input:checked) { border-color: var(--lime-ink); box-shadow: inset 0 0 0 1px var(--lime-ink); background: var(--surface-2); }
.m-resultado__opcao--positivo:has(input:checked) { border-color: var(--ok-bd); background: var(--ok-bg); box-shadow: none; }
.m-resultado__opcao--negativo:has(input:checked) { border-color: var(--err-bd); background: var(--err-bg); box-shadow: none; }
.m-retorno { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
/* seções que abrem e fecham */
.m-mais > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 30px; cursor: pointer; list-style: none;
  font: 650 15.5px/1.3 var(--font-display); color: var(--ink); }
.m-mais > summary::-webkit-details-marker { display: none; }
.m-mais > summary::after { content: ''; flex: none; width: 9px; height: 9px; margin: -4px 4px 0; border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.m-mais[open] > summary::after { margin-top: 4px; transform: rotate(-135deg); }
.m-mais--simples { padding: 12px 0 2px; border-top: 1px solid var(--border); }
.m-mais--simples > summary { font-size: 14.5px; font-weight: 600; }
.m-mais[open] > form, .m-mais[open] > .stack, .m-mais[open] > .vis-historico { margin-top: 10px; }
.m-mais > form + form { padding-top: 12px; border-top: 1px dashed var(--border); }
/* gravador no celular: o botão de gravar ocupa a largura toda */
.m-card .gravador__painel { justify-content: space-between; }
.m-card .gravador__rec { flex: 1 1 100%; justify-content: center; min-height: 60px; }
.m-dados { display: grid; gap: 10px; margin: 0; }
.m-dados dt { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.m-dados dd { margin: 0; font-size: 14.5px; color: var(--ink); }
.m-rodape { margin: 4px 0 0; text-align: center; font-size: 13.5px; color: var(--muted); }
/* abas do Comercial fixas no rodapé */
.m-abas { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -6px 18px rgba(15, 23, 42, .06); }
.m-abas a { display: grid; justify-items: center; gap: 3px; padding: 7px 2px 6px; border-radius: 14px; text-decoration: none;
  font: 600 11.5px/1.2 var(--font-display); color: var(--muted); }
.m-abas a.on { background: var(--sel-bg); color: var(--sel-fg); }
.m-abas svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
body.m #toast-root { bottom: calc(88px + env(safe-area-inset-bottom)); }

/* VISITA NO CELULAR — passo a passo (visita-mobile.ejs + [data-passos] no studio.js): topo com voltar, cliente, ⋯ e os
   pontinhos das etapas; uma etapa por tela; botão grande fixo embaixo. */
.mp-topo { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); background: var(--surface); border-bottom: 1px solid var(--border); }
.mp-topo__linha { display: flex; align-items: center; gap: 4px; min-height: 56px; padding: 4px 6px; }
.mp-menu { position: relative; flex: none; }
.mp-menu > summary { list-style: none; cursor: pointer; }
.mp-menu > summary::-webkit-details-marker { display: none; }
.mp-menu__painel { position: absolute; top: 50px; right: 0; z-index: 50; display: grid; min-width: 250px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); }
.mp-menu__painel a { display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 0 14px; border-radius: 12px; text-decoration: none;
  font: 600 15px/1.2 var(--font-display); color: var(--ink); }
.mp-menu__painel a:hover, .mp-menu__painel a:active { background: var(--surface-2); }
.mp-menu__painel svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* pontinhos das etapas, ligados por uma linha */
.mp-progresso { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 2px 10px 10px; list-style: none; }
.mp-progresso li { position: relative; }
.mp-progresso li + li::before { content: ''; position: absolute; top: 10px; right: 50%; width: 100%; height: 3px; background: var(--border); }
.mp-progresso li.feito + li::before, .mp-progresso li.feito + li.on::before { background: var(--lime-ink); }
.mp-progresso button { position: relative; z-index: 1; display: grid; justify-items: center; gap: 5px; width: 100%; padding: 0; border: 0;
  background: none; font: 600 11.5px/1.2 var(--font-display); color: var(--muted); cursor: pointer; }
.mp-progresso i { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; border: 3px solid var(--border-strong); background: var(--surface); }
.mp-progresso .feito i { background: var(--lime-ink); border-color: var(--lime-ink); }
.mp-progresso .feito i::after { content: ''; width: 5px; height: 9px; margin-top: -2px; border-right: 2px solid var(--surface); border-bottom: 2px solid var(--surface); transform: rotate(45deg); }
.mp-progresso .on i { border-color: var(--lime-ink); box-shadow: 0 0 0 4px var(--ok-bg); }
.mp-progresso .on button { color: var(--ink); }
/* travada = etapa à frente (apagada); feita e sem tela para reabrir (ex.: check-in) continua nítida, com o ✓ */
.mp-progresso button:disabled { cursor: default; }
.mp-progresso li:not(.feito) button:disabled { opacity: .55; }
.mp-progresso .feito button { color: var(--ink-body); }
/* a etapa: ocupa a tela e deixa espaço para o botão fixo */
.mp { width: 100%; max-width: 640px; margin: 0 auto; }
.mp > .flash { margin: 12px 14px 0; }
.mp-passo { display: grid; align-content: start; gap: 14px; min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px);
  padding: 16px 16px calc(120px + env(safe-area-inset-bottom)); }
.mp-passo[hidden] { display: none; }
.mp-cab { display: grid; gap: 6px; }
.mp-titulo { font: 700 25px/1.2 var(--font-display); letter-spacing: -.015em; color: var(--ink); overflow-wrap: anywhere; outline: none; }
.mp-quando { margin: 0; font: 600 15.5px/1.35 var(--font-display); color: var(--ink); }
.mp-texto { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-body); }
.mp-centro { text-align: center; }
.mp-mapa { height: 40vh; min-height: 220px; max-height: 380px; border-radius: 18px; }
.mp-endereco { display: grid; gap: 2px; }
.mp-endereco p { margin: 0; }
.mp-endereco__rua { font: 650 19px/1.3 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.mp-endereco__local { font-size: 15px; color: var(--ink-body); }
.mp-info { padding: 14px 16px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); }
.mp-info dd { overflow-wrap: anywhere; }
.mp-alvo { display: grid; place-items: center; width: 120px; height: 120px; margin: 18px auto 6px; border-radius: 50%;
  background: var(--ok-bg); color: var(--ok-fg); position: relative; }
.mp-alvo svg { width: 58px; height: 58px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mp-alvo::after { content: ''; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid var(--ok-bd); animation: mp-pulso 2s ease-out infinite; }
.mp-alvo--ok::after { animation: none; }
@keyframes mp-pulso { 0% { transform: scale(.85); opacity: 1; } 100% { transform: scale(1.25); opacity: 0; } }
.mp-audio-salvo { display: grid; gap: 8px; justify-items: start; }
.mp-gravador .gravador__painel { justify-content: space-between; }
.mp-gravador .gravador__rec { flex: 1 1 100%; justify-content: center; min-height: 64px; font-size: 17px; }
.mp-passo input[type=text], .mp-passo input[type=date], .mp-passo input[type=time], .mp-passo textarea, .mp-passo select { font-size: 16px; }
/* botão grande fixo embaixo (a próxima ação da etapa) */
.mp-rodape { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: grid; gap: 6px; margin: 0;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border);
  box-shadow: 0 -8px 22px rgba(15, 23, 42, .08); }
.mp-rodape .vis-geo__status { margin: 0; text-align: center; font-size: 13.5px; }
.mp-rodape .vis-geo__status:empty { display: none; }
.mp-rodape__nota { margin: 0; text-align: center; font-size: 14px; color: var(--ink-body); }
.mp-cta { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 58px; padding: 10px 16px;
  font-size: 18px; border-radius: 16px; text-decoration: none; }
.mp-cta svg { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
body.m--proprio #toast-root { bottom: calc(96px + env(safe-area-inset-bottom)); }
@media (min-width: 700px) {
  .mp-rodape { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) { .mp-alvo::after { animation: none; } }

/* VISITAS NO CELULAR — a lista em cartões por dia (visitas-mobile.ejs): topo fixo, busca, períodos e situações que rolam
   de lado, visita em andamento em destaque, "Ver mais visitas" e o botão de agendar acima das abas do Comercial. */
.mv-topo { position: sticky; top: 0; z-index: 40; padding-top: env(safe-area-inset-top); background: var(--surface); border-bottom: 1px solid var(--border); }
.mv-topo__linha { display: flex; align-items: center; gap: 6px; min-height: 60px; padding: 6px 6px 6px 16px; }
.mv-topo__titulo { display: grid; flex: 1; min-width: 0; }
.mv-topo__titulo b { font: 700 22px/1.2 var(--font-display); letter-spacing: -.01em; color: var(--ink); }
.mv-topo__titulo small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv { display: grid; gap: 12px; width: 100%; max-width: 640px; margin: 0 auto; padding: 12px 0 calc(170px + env(safe-area-inset-bottom)); }
.mv > * { margin-left: 12px; margin-right: 12px; min-width: 0; }
.mv > .flash { margin-top: 0; margin-bottom: 0; }
.mv-busca { position: relative; display: flex; align-items: center; gap: 8px; }
.mv-busca svg { position: absolute; left: 14px; width: 19px; height: 19px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.mv-busca input[type=search] { flex: 1; min-width: 0; height: 48px; padding: 0 14px 0 42px; border-radius: 14px; font-size: 16px; background: var(--surface); }
.mv-busca a { flex: none; font-size: 14px; font-weight: 600; }
/* botões que rolam de lado (período e situação) */
.mv-rolagem { display: flex; gap: 8px; margin: 0 !important; padding: 2px 12px; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mv-rolagem::-webkit-scrollbar { display: none; }
.mv-chip { display: inline-flex; flex: none; align-items: center; gap: 6px; min-height: 42px; padding: 0 15px; border-radius: 999px; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); font: 600 14px/1 var(--font-display); color: var(--ink-body); text-decoration: none; }
.mv-chip span { font: 500 12px/1 var(--font-mono); color: var(--muted); }
.mv-chip.on { background: var(--sel-bg); border-color: transparent; color: var(--sel-fg); }
.mv-chip.on span { color: inherit; opacity: .8; }
.mv-chip--alerta:not(.on) span { color: var(--err-fg); font-weight: 700; }
.mv-vendedor select { width: 100%; height: 46px; padding: 0 12px; border-radius: 14px; font-size: 16px; }
/* visita em andamento: o atalho mais importante do dia */
.mv-andamento { display: grid; gap: 10px; padding: 14px 16px; border-radius: 18px; background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-fg); }
.mv-andamento p { margin: 0; font-size: 14.5px; }
.mv-andamento b { color: var(--ink); }
.mv-numeros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mv-numeros div { display: grid; gap: 2px; padding: 10px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); }
.mv-numeros b { font: 700 20px/1.1 var(--font-display); color: var(--ink); }
.mv-numeros span { font-size: 11.5px; line-height: 1.25; color: var(--muted); }
/* a lista: um grupo por dia, com o rótulo do dia preso embaixo do topo enquanto rola */
.mv-lista { display: grid; gap: 16px; }
.mv-dia { display: grid; gap: 8px; }
.mv-dia__rotulo { position: sticky; top: calc(60px + env(safe-area-inset-top)); z-index: 5; margin: 0; padding: 8px 4px 4px; background: var(--bg);
  font: 650 12.5px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.mv-dia__rotulo--hoje { color: var(--ink); }
.mv-cards { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.mv-card { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 78px; padding: 12px 14px 12px 12px;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--border); border-left: 6px solid var(--border-strong); color: inherit; text-decoration: none; }
.mv-card:active { background: var(--surface-2); }
.mv-card--agendada { border-left-color: var(--mapa-cliente); }
.mv-card--atrasada { border-left-color: var(--err-fg); }
.mv-card--em_andamento { border-left-color: var(--warn-fg); }
.mv-card--concluida { border-left-color: var(--ok-fg); }
.mv-card--cancelada, .mv-card--nao_realizada { opacity: .75; }
.mv-card__hora { display: grid; gap: 2px; text-align: center; }
.mv-card__hora b { font: 700 17px/1.1 var(--font-display); color: var(--ink); }
.mv-card__hora small { font-size: 12px; color: var(--muted); }
.mv-card__corpo { display: grid; gap: 3px; min-width: 0; }
.mv-card__cliente { font: 650 16px/1.25 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-card__onde { font-size: 13.5px; color: var(--ink-body); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: var(--muted); }
.mv-card__meta .badge { padding: 1px 8px; font-size: 10.5px; }
.mv-card__seta { width: 10px; height: 10px; margin-right: 4px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); }
.mv-mais { justify-self: center; min-height: 48px; padding: 0 22px; border-radius: 999px; }
.mv-mostrando { margin: 0; text-align: center; font-size: 12.5px; color: var(--muted); }
.mv-vazio { display: grid; justify-items: center; gap: 8px; padding: 36px 16px; text-align: center; border-radius: 18px; background: var(--surface); border: 1px dashed var(--border-strong); }
.mv-vazio b { font: 650 17px/1.3 var(--font-display); color: var(--ink); }
.mv-vazio p { margin: 0; font-size: 14.5px; color: var(--ink-body); }
/* agendar: botão redondo acima das abas */
.mv-agendar { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 41; display: inline-flex; align-items: center; gap: 8px;
  min-height: 56px; padding: 0 22px; border-radius: 999px; font-size: 16.5px; box-shadow: 0 10px 24px rgba(15, 23, 42, .28); text-decoration: none; }
.mv-agendar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
@media (min-width: 700px) { .mv-agendar { right: calc(50% - 304px); } }
.mv-vazio[hidden] { display: none; }
.mv-busca input[type=search] { -webkit-appearance: none; appearance: none; border: 1px solid var(--border-strong); color: var(--ink); box-shadow: none; }
.mv-busca input[type=search]:focus { outline: 2px solid var(--lime-ink); outline-offset: 1px; }
.mv-card__quem { font-size: 12.5px; color: var(--muted); }
/* atalho da abrangência no topo da lista */
.mv-abr { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 14px; border-radius: 16px; background: var(--surface);
  border: 1px solid var(--border); color: inherit; text-decoration: none; }
.mv-abr svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mv-abr span { display: grid; flex: 1; min-width: 0; }
.mv-abr small { font: 600 10.5px/1.3 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.mv-abr b { font: 650 15.5px/1.3 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mv-abr i { width: 9px; height: 9px; flex: none; margin-right: 4px; border-top: 2px solid var(--muted); border-right: 2px solid var(--muted); transform: rotate(45deg); }

/* VERSÃO MOBILE — Abrangência (abrangencia-mobile.ejs): a atual em destaque e a árvore em linhas grandes, com recuo por nível */
.ma-atual { display: grid; gap: 8px; padding: 14px 16px; border-radius: 18px; background: var(--ok-bg); border: 1px solid var(--ok-bd); }
.ma-atual__linha { display: flex; align-items: center; gap: 12px; }
.ma-atual svg { width: 28px; height: 28px; flex: none; fill: none; stroke: var(--ok-fg); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ma-atual span { display: grid; min-width: 0; }
.ma-atual b { font: 700 18px/1.25 var(--font-display); color: var(--ink); overflow-wrap: anywhere; }
.ma-atual small { font-size: 13.5px; color: var(--ink-body); }
.ma-lista { display: grid; gap: 6px; margin-block: 0; padding: 0; list-style: none; }
.ma-lista li[hidden] { display: none; }
.ma-no { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 8px 14px 8px calc(14px + var(--prof, 0) * 16px); border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); color: inherit; text-decoration: none; }
.ma-no:active { background: var(--surface-2); }
.ma-no svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--muted); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ma-no span { display: grid; flex: 1; min-width: 0; }
.ma-no b { font: 600 15.5px/1.3 var(--font-display); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ma-no small { font-size: 12.5px; color: var(--muted); }
.ma-no--sem b { font-weight: 500; color: var(--ink-body); }
.ma-no.on { border-color: var(--lime-ink); box-shadow: inset 0 0 0 1px var(--lime-ink); background: var(--ok-bg); }
.ma-no.on svg { stroke: var(--ok-fg); }
.ma-no__ok { flex: none; width: 7px; height: 13px; margin: -3px 8px 0 4px; border-right: 2.5px solid var(--ok-fg); border-bottom: 2.5px solid var(--ok-fg); transform: rotate(45deg); }
.ma-contas select { width: 100%; height: 48px; padding: 0 12px; border-radius: 14px; font-size: 16px; }
@media (min-width: 700px) {
  .m-abas { left: 50%; right: auto; width: 640px; transform: translateX(-50%); border: 1px solid var(--border); border-bottom: 0; border-radius: 18px 18px 0 0; }
}

/* ---------- fotos da visita (partials/visita-fotos) ---------- */
.vf { display: grid; gap: 14px; }
.vf-form { display: grid; gap: 12px; }
.vf-tipos { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.vf-rotulo { font: 600 11px/1.4 var(--font-mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; padding: 0; }
.vf-tipo { position: relative; }
.vf-tipo input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.vf-tipo span { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 600 13.5px/1.2 var(--font-display); }
.vf-tipo input:checked + span { background: var(--sel-bg); color: var(--sel-fg); border-color: var(--sel-bg); }
.vf-tipo input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.vf-tipo__n { font: 600 11px/1 var(--font-mono); padding: 2px 6px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.vf-tipo input:checked + span .vf-tipo__n { background: rgba(255,255,255,.22); color: inherit; }
.vf-legenda { margin: 0; }
.vf-botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vf-botao { position: relative; min-height: 48px; }
.vf-botao svg { width: 20px; height: 20px; }
.vf-botao:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
/* o campo de arquivo fica por baixo do botão (acessível por teclado); o rótulo inteiro abre a câmera ou a galeria */
.vf-arquivo { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.vf-status { margin: 0; font-size: 13.5px; color: var(--muted); min-height: 0; }
.vf-status:empty { display: none; }
.vf-status.erro { color: var(--err-fg); }
.vf-form.enviando .vf-botao { opacity: .6; pointer-events: none; }
.vf-grupo { display: grid; gap: 8px; }
.vf-grupo__titulo { margin: 0; font: 600 14px/1.3 var(--font-display); }
.vf-grade { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.vf-foto { display: grid; gap: 4px; align-content: start; min-width: 0; }
.vf-foto__img { display: block; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.vf-foto__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.vf-foto__legenda { margin: 0; font-size: 12.5px; color: var(--ink-body); overflow-wrap: anywhere; }
.vf-foto__editar summary { font-size: 12.5px; color: var(--muted); cursor: pointer; padding: 4px 0; }
.vf-foto__editar[open] { display: grid; gap: 6px; }
.vf-foto__form { display: grid; gap: 6px; }
.vf-foto__form .field span { font-size: 12px; }
.vf-foto__apagar { color: var(--danger); }
.mp-fotos { display: grid; gap: 10px; margin-bottom: 18px; }
@media (max-width: 420px) { .vf-grade { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.vf-form [hidden] { display: none; }
.rem-recusar > summary { cursor: pointer; list-style: none; font-size: 13.5px; color: var(--muted); }
.rem-recusar > summary::-webkit-details-marker { display: none; }
.rem-recusar > summary b { color: var(--danger); font-weight: 600; }
.rem-recusar[open] > summary { border-bottom: 1px solid var(--border); }
/* ---- com quem está + painel Transferir (partials/equip-transferir) ---- */
.equip-com__linha { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.equip-com__quem { flex: 1 1 260px; display: grid; gap: 2px; min-width: 0; }
.equip-com__quem b { font: 650 16px/1.35 var(--font-display); color: var(--ink); }
.equip-com__quem small { font-size: 12.5px; color: var(--muted); overflow-wrap: anywhere; }
.equip-com__painel { padding: 4px 22px 20px; border-top: 1px solid var(--border); }
.equip-com__painel[hidden] { display: none; }
/* ---- situação atual na aba Ativação da ficha: há quanto tempo e, desativado, o motivo ---- */
.equip-status .card__body { display: grid; gap: 4px; }
.equip-status__rotulo { font: 600 10.5px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.equip-status__tempo { font: 700 22px/1.25 var(--font-display); color: var(--ink); }
.equip-status--ativo { border-color: var(--ok-bd); }
.equip-status--ativo .equip-status__tempo { color: var(--ok-fg); }
.equip-status--inativo { border-color: var(--err-bd); }
.equip-status__motivo { margin-top: 6px; padding: 8px 12px; border-radius: var(--r); background: var(--err-bg); color: var(--err-fg); font-size: 14px; }
.equip-status__motivo > span:first-child { font: 600 10.5px/1.3 var(--font-mono); letter-spacing: .06em; text-transform: uppercase; margin-right: 6px; }
/* ---- recebimento item a item (remessa.ejs) ---- */
.rem-estado { display: flex; gap: 16px; flex-wrap: wrap; }
.rem-estado input:disabled + * , .rem-estado label:has(input:disabled) { opacity: .5; }
.rem-avaria { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.rem-avaria[hidden] { display: none; }
.rem-avaria select, .rem-avaria input { flex: 1 1 200px; min-width: 0; padding: 7px 10px; font-size: 13px; }
.rem-receber tr.rem-linha--ok td { background: var(--ok-bg); }
.rem-receber tr.rem-linha--avaria td { background: var(--warn-bg); }
/* ---- "A caminho de X" na lista do Equipamento (transferência em aberto) ---- */
.equip-caminho { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin-top: 6px; padding: 4px 9px;
  border-radius: 999px; background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-fg); font-size: 12px; line-height: 1.3;
  text-decoration: none; }
.equip-caminho:hover { text-decoration: underline; }
.equip-caminho > span { min-width: 0; }
.equip-caminho small { font-size: inherit; opacity: .8; }
.equip-caminho svg { flex: none; width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ficha__corpo > .equip-caminho { margin: 0 0 8px; }
/* ---- leitor de código de barras no recebimento (remessa.ejs) ---- */
.rem-leitor { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 8px 10px 8px 14px; border: 2px dashed var(--border-strong);
  border-radius: var(--r); background: var(--surface-2); }
.rem-leitor:focus-within { border-color: var(--lime-ink); border-style: solid; }
.rem-leitor svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linecap: round; }
.rem-leitor input { flex: 1; min-width: 0; padding: 9px 4px; border: 0; background: transparent; color: var(--ink);
  font: 500 16px/1.3 var(--font-mono); letter-spacing: .03em; text-transform: uppercase; }
.rem-leitor input::placeholder { font-family: var(--font-body); letter-spacing: 0; text-transform: none; color: var(--muted); }
.rem-leitor input:focus { outline: none; }
.rem-leitor__msg { min-height: 20px; margin: 6px 0 0; font-size: 13.5px; font-weight: 600; }
.rem-leitor__msg--ok { color: var(--ok); }
.rem-leitor__msg--erro { color: var(--danger); }
.rem-leitor__msg--aviso { color: var(--warn-fg); }
.rem-camera { display: grid; gap: 8px; justify-items: start; margin-top: 8px; }
.rem-camera[hidden] { display: none; }
.rem-camera video { width: min(420px, 100%); border-radius: var(--r); background: #000; }
@keyframes rem-lida { from { background-color: var(--lime); } }
.rem-receber tr.rem-linha--lida td { animation: rem-lida 1s ease-out; }
.equip-com__painel-titulo { display: grid; gap: 2px; padding: 16px 0 4px; }
.equip-com__painel-titulo b { font: 650 16px/1.3 var(--font-display); color: var(--ink); }

/* remessa: rejeitados e devolução (volta para quem mandou) — src/views/studio/remessa.ejs */
.rem-receber tr.rem-linha--rej td { background: var(--err-bg); }
.rem-estado__rej { color: var(--danger); }
.rem-devolucao { margin: 0 0 12px; padding: 10px 14px; border: 1px solid var(--info-bd); background: var(--info-bg);
  color: var(--info-fg); border-radius: var(--r); font-size: 14px; }
.rem-devolucao a { color: inherit; font-weight: 600; }
.rem-retorno { border-top: 1px solid var(--border); background: var(--surface-2); }
.rem-retorno__titulo { display: block; font-size: 14px; }
