/* BF Ultra — Gestor (painel da equipe). Carregado só no Gestor e nas páginas de perfil "completo" (ver bfu_css_profile em inc/setup.php). */
/* ============================================================
   5.43.26 — GESTOR NO CELULAR (≤ 900 px): topo com a seção atual,
   barra inferior fixa e gaveta com todas as seções (inc/parts/gestor-mnav.php)
   ============================================================ */
.gm-top, .gm-tabbar, .gm-sheet { display:none; }
@media (max-width:900px) {
  body.bfu-gestor #site-header { position:relative; }
  body.bfu-gestor { padding-bottom:calc(64px + env(safe-area-inset-bottom)); }
  .gestor-sidebar { display:none !important; }
  .gestor-layout { display:block !important; min-height:0; }
  .gestor-layout > *, .gestor-content { min-width:0; }
  .gestor-content { padding:16px 16px 28px !important; overflow-x:clip; }
  .gestor-content h1 { font-size:20px !important; }
  /* grades de 2–3 colunas viram 1 coluna no telefone; tabelas largas rolam dentro do card */
  .gestor-content [style*="grid-template-columns:1fr 1fr"], .gestor-content [style*="grid-template-columns: 1fr 1fr"],
  .gestor-content [style*="grid-template-columns:2fr 1fr"], .gestor-content [style*="grid-template-columns:1fr 2fr"],
  .gestor-content [style*="grid-template-columns:1fr 3"], .gestor-content [style*="grid-template-columns:1fr 2"] { grid-template-columns:minmax(0,1fr) !important; }
  .gestor-content [style*="grid-template-columns:repeat(3,1fr)"], .gestor-content [style*="grid-template-columns:repeat(4,1fr)"],
  .gestor-content [style*="grid-template-columns:repeat(5,1fr)"], .gestor-content [style*="grid-template-columns:repeat(6,1fr)"] { grid-template-columns:repeat(2,minmax(0,1fr)) !important; }
  /* faixas de abas internas (Cobranças, Design…): rolam para o lado em vez de serem cortadas */
  .gestor-content [style*="display:flex"][style*="border-bottom"] { overflow-x:auto; scrollbar-width:none; -webkit-overflow-scrolling:touch; }
  .gestor-content [style*="display:flex"][style*="border-bottom"] > a { flex-shrink:0; white-space:nowrap; }
  .bfm-grid { grid-template-columns:minmax(0,1fr) !important; }
  .gestor-content [style*="display:flex"]:not([style*="border-bottom"]):not([style*="nowrap"]) { flex-wrap:wrap; }
  .gestor-content table { display:block; max-width:100%; overflow-x:auto; -webkit-overflow-scrolling:touch; }

  .gm-top { position:fixed; top:0; left:0; right:0; z-index:950; display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:52px; padding:6px 12px 6px 16px; padding-top:calc(6px + env(safe-area-inset-top)); background:var(--bg-card); border-bottom:.5px solid var(--border); box-shadow:0 4px 14px -10px rgba(0,0,0,.35); transform:translateY(-110%); transition:transform .2s ease; visibility:hidden; }
  .gm-top.is-on { transform:none; visibility:visible; }
  .gm-top__act { display:flex; align-items:center; gap:6px; flex-shrink:0; }
  .gm-top__btn { display:inline-flex; align-items:center; gap:5px; height:36px; padding:0 12px; border:.5px solid var(--border-2); border-radius:10px; background:var(--bg-card); color:var(--text-2); font:600 13px var(--font); text-decoration:none; cursor:pointer; white-space:nowrap; }
  .gm-top__btn--save { border-color:var(--red); background:var(--red); color:#fff; }
  .gm-top__btn[hidden] { display:none; }
  .gm-top__menu { display:inline-flex; align-items:center; justify-content:center; width:42px; height:42px; border:none; border-radius:10px; background:none; color:var(--text); cursor:pointer; }
  .gm-top__menu:active { background:var(--bg-2); }
  .gm-top__t { min-width:0; display:flex; flex-direction:column; line-height:1.15; }
  .gm-top__t small { font-size:10px; font-weight:700; letter-spacing:.1em; text-transform:uppercase; color:var(--text-3); }
  .gm-top__t strong { display:flex; align-items:center; gap:6px; font-size:16px; font-weight:800; color:var(--text); }
  .gm-top__t strong svg { color:var(--red); flex-shrink:0; }
  .gm-top__t strong span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

  .gm-tabbar { position:fixed; left:0; right:0; bottom:0; z-index:900; display:grid; grid-template-columns:repeat(4,1fr); padding:4px 4px calc(4px + env(safe-area-inset-bottom)); background:var(--bg-card); border-top:.5px solid var(--border); box-shadow:0 -6px 18px -12px rgba(0,0,0,.35); }
  .gm-tab { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:3px; min-height:54px; padding:4px 2px; border:none; border-radius:10px; background:none; color:var(--text-3); font:600 11px var(--font); text-decoration:none; cursor:pointer; -webkit-tap-highlight-color:transparent; }
  .gm-tab span { max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .gm-tab.is-on { color:var(--red); }
  .gm-tab.is-on svg { stroke-width:2.1; }
  .gm-tab:active { background:var(--bg-2); }

  .gm-sheet { position:fixed; inset:0; z-index:1000; display:block; }
  .gm-sheet[hidden] { display:none; }
  .gm-sheet__bg { position:absolute; inset:0; background:rgba(0,0,0,.45); opacity:0; transition:opacity .2s; }
  .gm-sheet__panel { position:absolute; left:0; right:0; bottom:0; display:flex; flex-direction:column; max-height:86vh; max-height:86dvh; background:var(--bg-card); border-radius:18px 18px 0 0; transform:translateY(100%); transition:transform .22s cubic-bezier(.3,.7,.2,1); padding-bottom:env(safe-area-inset-bottom); }
  .gm-sheet.is-open .gm-sheet__bg { opacity:1; }
  .gm-sheet.is-open .gm-sheet__panel { transform:none; }
  .gm-sheet__grip { width:40px; height:4px; margin:8px auto 2px; border-radius:4px; background:var(--border-2); }
  .gm-sheet__h { display:flex; align-items:center; gap:8px; padding:8px 14px 10px; }
  .gm-find { flex:1; display:flex; align-items:center; gap:8px; height:44px; padding:0 12px; border:.5px solid var(--border-2); border-radius:12px; background:var(--bg-2); color:var(--text-3); }
  .gm-find input { flex:1; min-width:0; height:100%; border:none; background:none; outline:none; font:16px var(--font); color:var(--text); }
  .gm-sheet__x { display:inline-flex; align-items:center; justify-content:center; width:44px; height:44px; border:none; border-radius:12px; background:none; color:var(--text-2); cursor:pointer; }
  .gm-sheet__body { overflow-y:auto; overscroll-behavior:contain; padding:2px 14px 16px; }
  .gm-grp { margin-bottom:14px; }
  .gm-grp[hidden], .gm-item[hidden] { display:none !important; }
  .gm-grp h3 { margin:0 2px 8px; font-size:10.5px; font-weight:700; letter-spacing:.09em; text-transform:uppercase; color:var(--text-3); }
  .gm-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
  .gm-item { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; min-height:78px; padding:10px 6px; border:.5px solid var(--border); border-radius:14px; background:var(--bg-card); color:var(--text-2); font-size:12px; font-weight:600; line-height:1.2; text-align:center; text-decoration:none; }
  .gm-item svg { color:var(--text-2); }
  .gm-item.is-on { border-color:rgba(180,0,0,.35); background:rgba(180,0,0,.06); color:var(--red); }
  .gm-item.is-on svg { color:var(--red); }
  .gm-item:active { background:var(--bg-2); }
  .gm-none { padding:20px; text-align:center; color:var(--text-3); font-size:13px; }
  .gm-foot { display:flex; justify-content:center; gap:22px; padding:6px 0 4px; border-top:.5px solid var(--border); margin-top:4px; }
  .gm-foot a { padding:10px 4px; font-size:13px; font-weight:600; color:var(--text-3); text-decoration:none; }
  html.gm-lock, html.gm-lock body { overflow:hidden; }
}
@media (max-width:359px) { .gm-grid { grid-template-columns:repeat(2,minmax(0,1fr)); } }

/* ============================================================
   5.43.27 — Gestor no celular: densidade (fontes, espaços, campos), Dashboard
   compacto e lista de Tabelas em cartões
   ============================================================ */
@media (max-width:900px) {
  /* o título da seção já aparece na barra do topo: o h1 de cada seção fica menor */
  .gestor-content h1 { font-size:19px !important; margin-bottom:2px !important; }
  .gestor-content h2 { font-size:15px !important; }
  .gestor-content [style*="margin-bottom:32px"] { margin-bottom:18px !important; }
  .gestor-content [style*="margin-bottom:28px"] { margin-bottom:16px !important; }
  .gestor-content [style*="padding:20px"] { padding:14px !important; }
  .gestor-content [style*="padding:24px"] { padding:16px !important; }
  .gestor-content [style*="padding:40px"], .gestor-content [style*="padding:48px"] { padding:24px 16px !important; }
  .gestor-content [style*="font-size:28px"] { font-size:22px !important; }
  /* campos: mesma altura e letra menor (sem zoom no iPhone — ver gestor-mnav.php) */
  .gestor-content select, .gestor-content input[type="text"], .gestor-content input[type="search"], .gestor-content input[type="email"], .gestor-content input[type="number"], .gestor-content input[type="date"] { font-size:13px !important; min-width:0; }
  .gestor-content select { padding-left:8px !important; padding-right:22px !important; text-overflow:ellipsis; }
  /* ações dentro de tabelas não quebram em várias linhas */
  .gestor-content td [style*="display:flex"] { flex-wrap:nowrap !important; }

  /* filtros de listas (Tabelas, GDA…): busca na linha toda, 3 filtros lado a lado, botão na linha toda */
  .gestor-content [style*="grid-template-columns:2.2fr 1fr 1fr 1fr auto"], .gestor-content [style*="grid-template-columns:2fr 1fr 1fr 1fr auto"] { grid-template-columns:repeat(3,minmax(0,1fr)) !important; gap:8px 6px !important; }
  .gestor-content [style*="grid-template-columns:2.2fr 1fr 1fr 1fr auto"] > :first-child, .gestor-content [style*="grid-template-columns:2fr 1fr 1fr 1fr auto"] > :first-child,
  .gestor-content [style*="grid-template-columns:2.2fr 1fr 1fr 1fr auto"] > :last-child, .gestor-content [style*="grid-template-columns:2fr 1fr 1fr 1fr auto"] > :last-child { grid-column:1 / -1; }
  .gestor-content [style*="grid-template-columns:2.2fr 1fr 1fr 1fr auto"] > button:last-child, .gestor-content [style*="grid-template-columns:2fr 1fr 1fr 1fr auto"] > button:last-child { height:38px; justify-content:center; }
  #veic-filter-form { padding:12px !important; }

  /* Dashboard */
  .gestor-content .gd-head { margin-bottom:14px !important; }
  .gestor-content .gd-head h1 + p { font-size:12px !important; }
  .gestor-content .gd-head > div:last-child { gap:8px !important; }
  .gestor-content .gd-head > div:last-child > span { font-size:11px !important; }
  .gestor-content .gd-metrics { grid-template-columns:repeat(2,minmax(0,1fr)) !important; gap:8px !important; margin-bottom:14px !important; }
  .gestor-content .gd-metric { padding:10px 12px !important; border-radius:var(--r-md) !important; }
  .gestor-content .gd-metric p:first-child { font-size:9.5px !important; margin-bottom:4px !important; letter-spacing:.06em !important; }
  .gestor-content .gd-metric p:last-child { font-size:20px !important; }
  .gestor-content .gd-chart { height:160px !important; }
  .dash-period-btn { padding:4px 7px !important; font-size:10.5px !important; }

  /* Tabelas: cada linha vira um cartão */
  #veic-tbl { display:block !important; overflow:visible !important; font-size:13px; }
  #veic-tbl thead, #veic-tbl tbody { display:block; }
  #veic-head { display:flex !important; align-items:center; gap:10px; height:auto !important; min-height:44px; padding:0 14px 0 0; }
  #veic-head .veic-hd { display:none; }
  #veic-head > th:first-child::after { content:'Selecionar todas'; margin-left:10px; font-size:12px; font-weight:600; color:var(--text-3); text-transform:none; vertical-align:2px; }
  #veic-head > th:first-child { display:flex; align-items:center; width:auto !important; white-space:nowrap; }
  #veic-bulk-th:not([hidden]) { display:block; padding:6px 0 !important; }
  #veic-bulk-th:not([hidden]) ~ th, #veic-head:has(#veic-bulk-th:not([hidden])) > th:first-child::after { display:none; }
  /* 5.43.28: selos (SEO, anel gratuito/exclusivo, situação) na lateral direita; ações numa linha embaixo */
  .veic-row { display:grid !important; grid-template-columns:30px minmax(0,1fr) auto; grid-template-areas:"sel veic seo" "sel veic ac" "sel motor st" "sel act act"; column-gap:8px; row-gap:6px; padding:12px 12px 12px 0; }
  .veic-row > td { display:block; padding:0 !important; width:auto !important; border:none; }
  .veic-row .vt-sel { grid-area:sel; padding:2px 0 0 12px !important; }
  .veic-row .vt-veic { grid-area:veic; min-width:0; }
  .veic-row .vt-veic p:first-child { font-size:14px; line-height:1.3; }
  .veic-row .vt-motor { grid-area:motor; font-size:12px !important; align-self:end; }
  .veic-row .vt-seo { grid-area:seo; justify-self:end; }
  .veic-row .vt-ac { grid-area:ac; justify-self:end; }
  .veic-row .vt-st { grid-area:st; justify-self:end; align-self:end; }
  .veic-row .vt-act { grid-area:act; padding-top:8px !important; border-top:.5px dashed var(--border) !important; }
  .veic-row .vt-act > div { display:flex !important; justify-content:space-between; gap:6px !important; }
  .veic-row .vt-act a, .veic-row .vt-act button { flex:1 1 0; width:auto !important; max-width:52px; height:34px !important; }

  /* 5.43.60 Cursos e Manuais: cada item vira um cartão (título + situação, etiquetas, ações numa linha embaixo) */
  :is(#bfuc-tbl,#bfum-tbl) { display:block !important; overflow:visible !important; }
  :is(#bfuc-tbl,#bfum-tbl) thead { display:none; }
  :is(#bfuc-tbl,#bfum-tbl) tbody { display:block; }
  :is(#bfuc-tbl,#bfum-tbl) tbody tr:not(.bfuc-row):not(.bfum-row) { display:block; }
  :is(#bfuc-tbl,#bfum-tbl) tbody tr:not(.bfuc-row):not(.bfum-row) > td { display:block; width:auto; }
  :is(.bfuc-row,.bfum-row) { display:flex !important; flex-wrap:wrap; align-items:center; gap:8px 12px; padding:12px 14px; border-bottom:.5px solid var(--border); }
  :is(.bfuc-row,.bfum-row)[style*="display: none"], :is(.bfuc-row,.bfum-row)[style*="display:none"] { display:none !important; }
  :is(.bfuc-row,.bfum-row) > td { display:block; padding:0 !important; border:none !important; width:auto !important; }
  :is(.bfuc-row,.bfum-row) .bc-main { order:1; flex:0 0 100%; min-width:0; }
  :is(.bfuc-row,.bfum-row) .bc-title { font-size:14px !important; line-height:1.3; }
  :is(.bfuc-row,.bfum-row) .bc-tipo { order:2; }
  :is(.bfuc-row,.bfum-row) .bc-st { order:3; white-space:nowrap; }
  :is(.bfuc-row,.bfum-row) .bc-preco { order:4; }
  :is(.bfuc-row,.bfum-row) .bc-parc { order:5; }
  :is(.bfuc-row,.bfum-row) .bc-hot { order:6; margin-left:auto; }
  :is(.bfuc-row,.bfum-row) .is-empty { display:none !important; }
  :is(.bfuc-row,.bfum-row) .bc-act { order:7; flex:0 0 100%; padding-top:10px !important; border-top:.5px dashed var(--border) !important; }
  :is(.bfuc-row,.bfum-row) .bc-act > div { display:flex !important; justify-content:space-between; gap:6px !important; }
  :is(.bfuc-row,.bfum-row) .bc-act a, :is(.bfuc-row,.bfum-row) .bc-act button { flex:1 1 0; width:auto !important; max-width:52px; height:34px !important; }
}

/* Usuários: colunas Usuário (nome + username · tag) | CPF (olho) | E-mail | WhatsApp | Plano | Ações (v5.50.1) */
#users-tbl td:nth-child(5), #users-tbl td:nth-child(6) { white-space:nowrap; }
#users-tbl td:nth-child(4) a { white-space:nowrap; }
@media (max-width:1280px) { #users-tbl td, #users-tbl th { padding-left:10px !important; padding-right:10px !important; } #users-tbl .ut-mail { max-width:170px !important; } #users-tbl .ut-user { max-width:220px !important; } }

/* Usuários no celular: cada pessoa vira um cartão (nome + plano, username · tag, e-mail, CPF, WhatsApp, ações) */
@media (max-width:900px) {
  .ut-wrap { overflow:hidden !important; }
  #users-tbl { display:block !important; overflow:visible !important; }
  #users-tbl thead { display:block; }
  #users-tbl thead tr { display:flex; align-items:center; padding:8px 14px; }
  #users-tbl thead th { display:none; padding:0 !important; }
  #users-tbl thead th:nth-child(2) { display:block; }
  #users-tbl tbody { display:block; }
  #users-tbl tbody tr { display:grid !important; grid-template-columns:minmax(0,1fr) auto auto; grid-template-areas:"user user plan" "mail mail mail" "cpf cpf cpf" "wa act act"; gap:6px 10px; padding:12px 14px; }
  #users-tbl tbody tr > td { display:block; padding:0 !important; max-width:none !important; border:none; min-width:0; }
  #users-tbl tbody tr > td[colspan] { grid-column:1 / -1; padding:24px 0 !important; }
  #users-tbl td:nth-child(1) { grid-area:user; }
  #users-tbl td:nth-child(2) { grid-area:cpf; font-size:11px !important; }
  #users-tbl td.is-empty { display:none !important; }
  #users-tbl .ut-name { white-space:normal !important; display:-webkit-box !important; -webkit-line-clamp:2; -webkit-box-orient:vertical; line-height:1.3; }
  #users-tbl thead th:nth-child(2)::after { content:' (mostrar/ocultar)'; font-weight:500; text-transform:none; letter-spacing:0; }
  #users-tbl td:nth-child(2)::before { content:'CPF '; font-family:var(--font); font-size:10px; font-weight:700; color:var(--text-3); }
  #users-tbl td:nth-child(3) { grid-area:mail; font-size:12.5px !important; overflow:hidden; text-overflow:ellipsis; }
  #users-tbl td:nth-child(4) { grid-area:wa; align-self:center; overflow:hidden; }
  #users-tbl td:nth-child(5) { grid-area:plan; text-align:right; }
  #users-tbl td:nth-child(5) br { display:none; }
  #users-tbl td:nth-child(5) br + span { display:block; margin-top:2px; }
  #users-tbl td:nth-child(6) { grid-area:act; align-self:center; }
  #users-tbl td:nth-child(6) > div { gap:4px !important; }
  #users-tbl td:nth-child(6) button { width:32px !important; height:32px !important; }
  /* Dashboard: a coluna do gráfico e de usuários recentes não passa da tela */
  .gd-row, .gd-left { min-width:0; }
  .gd-left > * { min-width:0; max-width:100%; box-sizing:border-box; }
  .gd-chart canvas { max-width:100%; }
}

/* ============================================================
   5.43.28 — Anel gratuito/exclusivo nos cards (bfu_access_ring / search.js)
   ============================================================ */
.bf-ring { position:relative; display:inline-block; flex:0 0 auto; width:var(--s,48px); height:var(--s,48px); border-radius:50%; vertical-align:middle; }
.bf-ring__svg { position:absolute; inset:0; width:100%; height:100%; transform:rotate(-90deg); overflow:visible; }
.bf-ring__svg circle { fill:none; stroke-width:7; }
.bf-ring__ex { stroke:var(--red, #B40000); }
.bf-ring__fr { stroke:#2D8B55; }
.bf-ring__in { position:absolute; inset:calc(var(--s,48px) * .1); display:flex; align-items:center; justify-content:center; border-radius:50%; background:#fff; overflow:hidden; }
.bf-ring__in img { display:block; width:auto !important; height:auto !important; max-width:70%; max-height:52%; object-fit:contain; padding:0 !important; }
.bf-ring__in b { font-size:calc(var(--s,48px) * .28); font-weight:800; letter-spacing:.02em; color:#3a3a3a; line-height:1; }
.bf-ring--mini .bf-ring__in { inset:4px; background:var(--bg-card); }
.bf-ring--mini .bf-ring__in b { font-size:9px; letter-spacing:0; color:var(--text-2); }
.bf-ring-txt { display:block; font-size:10.5px; font-weight:600; color:var(--text-3); line-height:1.3; }
@media (min-width:601px) and (max-width:782px) { body.admin-bar.bfu-gestor .gm-top { top:46px; } }


/* ============================================================
   5.43.58 — Gestor › Montadoras: cartões com botões organizados
   ============================================================ */
.gmk-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:16px; }
.gmk-card { display:flex; flex-direction:column; background:var(--bg-card); border:.5px solid var(--border); border-radius:var(--r-lg); overflow:hidden; min-width:0; }
.gmk-logo { height:72px; flex:none; background:var(--bg-2); display:flex; align-items:center; justify-content:center; border-bottom:.5px solid var(--border); padding:0 10px; }
.gmk-logo img { max-width:100%; }
.gmk-logo__txt { font-size:18px; font-weight:900; text-align:center; line-height:1.15; overflow-wrap:anywhere; }
.gmk-body { display:flex; flex-direction:column; flex:1; padding:12px 14px 14px; }
.gmk-head { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:2px; }
.gmk-name { font-size:13px; font-weight:700; margin:0; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.gmk-dot { width:10px; height:10px; border-radius:50%; flex:none; box-shadow:0 0 0 1px rgba(0,0,0,.08); }
.gmk-cnt { font-size:11px; color:var(--text-3); margin:0 0 12px; }
.gmk-act { display:flex; gap:6px; margin-top:auto; }
.gmk-btn { flex:1 1 0; min-width:0; height:34px; display:inline-flex; align-items:center; justify-content:center; gap:5px; padding:0 6px; border-radius:8px; font-size:12px; font-weight:600; text-decoration:none; font-family:var(--font); cursor:pointer; white-space:nowrap; transition:background .15s,border-color .15s; }
.gmk-btn--edit { color:var(--red); border:.5px solid rgba(180,0,0,.3); background:rgba(180,0,0,.04); }
.gmk-btn--edit:hover { background:rgba(180,0,0,.09); }
.gmk-btn--del { color:var(--text-3); border:.5px solid var(--border-2); background:transparent; }
.gmk-btn--del:hover { color:var(--red); border-color:rgba(180,0,0,.3); background:rgba(180,0,0,.05); }
.gmk-empty { grid-column:1 / -1; padding:48px; text-align:center; color:var(--text-3); background:var(--bg-card); border:.5px solid var(--border); border-radius:var(--r-lg); }
@media (max-width:900px) {
  .gmk-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .gmk-logo { height:64px; }
  .gmk-body { padding:10px 10px 12px; }
  .gmk-empty { padding:32px 16px; }
}
@media (max-width:359px) { .gmk-grid { grid-template-columns:minmax(0,1fr); } }
