/* Admin CSS - Mobile First - visual alinhado ao site do cliente */
:root {
  /* paleta do site */
  --bg: #0b1220; --surface: #121a2b; --surface-2: #18223a; --border: #22304d;
  --text: #e8eef9; --text-2: #94a3b8; --brand: #22c55e; --brand-2: #16a34a;
  --gold: #f0b429; --red: #ef4444; --blue: #3b82f6;
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-num: 'Barlow Condensed', 'Inter', sans-serif;
  /* aliases antigos (paginas existentes usam estes nomes) */
  --bg-main: var(--bg); --bg-card: var(--surface); --bg-sidebar: #0d1526;
  --primary: var(--brand); --accent: var(--gold); --danger: var(--red);
  --text-muted: var(--text-2); --text-dark: var(--text-2);
}
* { margin:0; padding:0; box-sizing:border-box; }
html { -webkit-text-size-adjust:100%; }
body.admin-body { font-family:var(--font); background:var(--bg); color:var(--text); min-height:100vh; font-size:14px; line-height:1.45; }
body.admin-body input, body.admin-body select, body.admin-body button, body.admin-body textarea { font-family:inherit; }
a { color:var(--brand); }
code { font-family:ui-monospace, SFMono-Regular, Menlo, monospace; font-size:12px; color:var(--text); background:var(--surface-2); padding:1px 5px; border-radius:4px; word-break:break-all; }

/* Sidebar */
.admin-sidebar {
  position:fixed; left:0; top:0; bottom:0; width:240px; background:var(--bg-sidebar);
  border-right:1px solid var(--border); z-index:200; transition:transform .3s;
  overflow-y:auto; display:flex; flex-direction:column;
}
.sidebar-logo { display:flex; align-items:center; gap:10px; padding:18px 16px; border-bottom:1px solid var(--border); }
.logo-icon { width:36px; height:36px; background:linear-gradient(135deg,var(--brand-2),var(--brand)); border-radius:8px; display:flex; align-items:center; justify-content:center; color:#04220f; font-size:16px; }
.logo-text { font-size:16px; font-weight:800; letter-spacing:.3px; }
.admin-badge { font-size:9px; background:var(--brand); color:#04220f; padding:2px 6px; border-radius:3px; font-weight:800; vertical-align:middle; margin-left:4px; }
.sidebar-nav { flex:1; padding:8px 0; }
.nav-section-title { padding:12px 16px 4px; font-size:10px; font-weight:700; letter-spacing:1.4px; color:var(--text-2); opacity:.75; text-transform:uppercase; }
.nav-item { display:flex; align-items:center; gap:10px; padding:11px 16px; color:var(--text-2); font-size:14px; font-weight:500; text-decoration:none; transition:all .15s; border-left:3px solid transparent; }
.nav-item:hover { background:var(--surface); color:var(--text); }
.nav-item.active { background:rgba(34,197,94,.1); color:var(--brand); border-left-color:var(--brand); font-weight:700; }
.nav-item i { width:18px; text-align:center; font-size:14px; }
.nav-item .badge { margin-left:auto; background:var(--red); color:#fff; font-size:10px; padding:2px 7px; border-radius:10px; font-weight:700; }
.sidebar-footer { padding:12px 16px; border-top:1px solid var(--border); }
.sidebar-footer a { display:flex; align-items:center; gap:8px; color:var(--text-2); font-size:13px; text-decoration:none; }
.sidebar-footer a:hover { color:var(--text); }

/* Main content */
.admin-main { margin-left:240px; min-height:100vh; }
.admin-topbar { display:flex; align-items:center; justify-content:space-between; padding:12px 20px; border-bottom:1px solid var(--border); background:rgba(11,18,32,.92); backdrop-filter:blur(6px); position:sticky; top:0; z-index:100; }
.topbar-left { display:flex; align-items:center; gap:12px; min-width:0; }
.menu-toggle { display:none; background:none; border:none; color:var(--text); font-size:20px; cursor:pointer; padding:6px; min-width:40px; min-height:40px; }
.page-title { font-size:18px; font-weight:700; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.topbar-right { display:flex; align-items:center; gap:12px; }
.topbar-time { font-size:12px; color:var(--text-2); font-variant-numeric:tabular-nums; }

/* Cards de resumo */
.admin-content { padding:20px; max-width:1400px; }
.stats-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:14px; margin-bottom:24px; }
.stat-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:16px; transition:border-color .2s; min-width:0; }
.stat-card:hover { border-color:#2d3f63; }
a.stat-card { display:block; text-decoration:none; color:inherit; }
.stat-card-icon { width:38px; height:38px; border-radius:8px; display:flex; align-items:center; justify-content:center; font-size:17px; margin-bottom:10px; }
.stat-card-icon.green { background:rgba(34,197,94,.14); color:var(--brand); }
.stat-card-icon.gold { background:rgba(240,180,41,.14); color:var(--gold); }
.stat-card-icon.red { background:rgba(239,68,68,.14); color:var(--red); }
.stat-card-icon.blue { background:rgba(59,130,246,.14); color:var(--blue); }
.stat-card-label { font-size:11px; color:var(--text-2); text-transform:uppercase; letter-spacing:.5px; font-weight:600; }
.stat-card-value { font-family:var(--font-num); font-size:30px; font-weight:700; line-height:1.1; margin:4px 0 2px; font-variant-numeric:tabular-nums; letter-spacing:.2px; overflow-wrap:anywhere; }
.stat-card-value.pos { color:var(--brand); } .stat-card-value.neg { color:var(--red); }
.stat-card-sub { font-size:12px; color:var(--text-2); }

/* Tabelas */
.admin-table-wrap { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); overflow:hidden; margin-bottom:20px; }
.admin-table-header { display:flex; align-items:center; justify-content:space-between; gap:8px; flex-wrap:wrap; padding:14px 16px; border-bottom:1px solid var(--border); }
.admin-table-title { font-size:15px; font-weight:700; display:flex; align-items:center; gap:8px; }
.admin-table-actions { display:flex; gap:8px; flex-wrap:wrap; }
.admin-table { width:100%; border-collapse:collapse; }
.admin-table th { padding:10px 14px; font-size:11px; font-weight:700; letter-spacing:.5px; text-transform:uppercase; color:var(--text-2); text-align:left; border-bottom:1px solid var(--border); background:var(--surface-2); white-space:nowrap; }
.admin-table td { padding:10px 14px; font-size:13px; border-bottom:1px solid rgba(34,48,77,.6); vertical-align:top; font-variant-numeric:tabular-nums; }
.admin-table tr:hover td { background:rgba(24,34,58,.5); }
.admin-table td.n, .admin-table th.n { text-align:right; }

/* Status badges */
.badge-status { display:inline-block; padding:3px 10px; border-radius:12px; font-size:11px; font-weight:700; background:rgba(148,163,184,.12); color:var(--text-2); white-space:nowrap; }
.badge-ativa, .badge-confirmado, .badge-pago, .badge-vencedora, .badge-ganha, .badge-concluido { background:rgba(34,197,94,.14); color:var(--brand); }
.badge-pendente, .badge-processando, .badge-em_analise, .badge-aguardando { background:rgba(240,180,41,.14); color:var(--gold); }
.badge-processado, .badge-aprovado, .badge-encerrada { background:rgba(59,130,246,.14); color:#60a5fa; }
.badge-rejeitado, .badge-cancelado, .badge-perdida, .badge-falhou_estornado, .badge-expirado { background:rgba(239,68,68,.14); color:#f87171; }

/* Botoes */
.btn-admin { padding:9px 16px; min-height:38px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; border:none; transition:all .2s; display:inline-flex; align-items:center; justify-content:center; gap:6px; text-decoration:none; }
.btn-admin:disabled { opacity:.55; cursor:not-allowed; }
.btn-admin.green { background:var(--brand); color:#04220f; }
.btn-admin.green:hover { background:#34d06c; }
.btn-admin.red { background:var(--red); color:#fff; }
.btn-admin.outline { background:transparent; border:1px solid var(--border); color:var(--text-2); }
.btn-admin.outline:hover { border-color:var(--brand); color:var(--brand); }
.btn-admin.sm { padding:5px 10px; min-height:30px; font-size:12px; }

/* Filtros */
.filter-bar { display:flex; gap:8px; padding:12px 16px; border-bottom:1px solid var(--border); flex-wrap:wrap; align-items:center; }
.filter-input, .filter-select { background:var(--bg); border:1px solid var(--border); color:var(--text); padding:9px 12px; border-radius:8px; font-size:14px; min-height:40px; max-width:100%; }
.filter-input:focus, .filter-select:focus { outline:none; border-color:var(--brand); }
.filter-input[type=date] { color-scheme:dark; }

/* Segmentado (filtro de periodo) */
.seg { display:inline-flex; background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:3px; gap:2px; flex-wrap:wrap; }
.seg button { background:none; border:0; color:var(--text-2); padding:8px 12px; border-radius:8px; font-size:13px; font-weight:600; cursor:pointer; min-height:36px; }
.seg button.on { background:var(--brand); color:#04220f; }
.toolbar { display:flex; flex-wrap:wrap; gap:8px; align-items:center; margin-bottom:16px; }
.toolbar .grow { flex:1; }
.muted { color:var(--text-2); }
.small { font-size:12px; }
.pos { color:var(--brand); } .neg { color:var(--red); }

/* Paineis / grafico */
.panel, .admin-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px 16px; margin-bottom:20px; }
.panel h3 { font-size:15px; font-weight:700; margin-bottom:10px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
.chart-wrap { width:100%; overflow-x:auto; }
.chart-wrap svg { display:block; width:100%; height:auto; min-width:300px; }
.legend { display:flex; gap:14px; font-size:12px; color:var(--text-2); flex-wrap:wrap; }
.legend i { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:5px; vertical-align:-1px; }

/* Abas */
.tabs { display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--border); margin-bottom:12px; scrollbar-width:none; }
.tabs button { background:none; border:0; border-bottom:2px solid transparent; color:var(--text-2); padding:10px 12px; font-size:13px; font-weight:600; cursor:pointer; white-space:nowrap; }
.tabs button.on { color:var(--brand); border-bottom-color:var(--brand); }

/* Paginacao */
.pager { display:flex; align-items:center; justify-content:center; gap:10px; padding:12px; flex-wrap:wrap; font-size:13px; color:var(--text-2); }

/* Modal simples */
.adm-modal { position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; align-items:flex-end; justify-content:center; z-index:2000; }
.adm-modal.show { display:flex; }
.adm-modal .box { background:var(--surface); border:1px solid var(--border); border-radius:14px 14px 0 0; width:100%; max-width:560px; max-height:88vh; overflow:auto; padding:16px; }
.adm-modal h3 { font-size:16px; margin-bottom:10px; }
.adm-modal label { display:block; font-size:12px; color:var(--text-2); margin:10px 0 4px; }
.adm-modal input, .adm-modal textarea { width:100%; background:var(--bg); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:10px; font-size:14px; }
.adm-modal .acts { display:flex; gap:8px; justify-content:flex-end; margin-top:14px; flex-wrap:wrap; }
@media (min-width:768px) { .adm-modal { align-items:center; } .adm-modal .box { border-radius:14px; } }

/* Cards mobile (alternativa a tabela) */
.mobile-card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:14px; margin-bottom:10px; }
.mobile-card-header { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.mobile-card-row { display:flex; justify-content:space-between; padding:4px 0; font-size:13px; }
.mobile-card-label { color:var(--text-2); }
.mobile-card-value { font-weight:600; }
.mobile-card-actions { display:flex; gap:6px; margin-top:10px; }

/* Overlay loading */
.admin-loading { display:flex; flex-direction:column; align-items:center; justify-content:center; padding:60px; color:var(--text-2); gap:12px; }
.admin-loading i { font-size:28px; }
.admin-empty { text-align:center; padding:40px; color:var(--text-2); }
.admin-error { background:#3b0d0d; border:1px solid var(--red); color:#fecaca; border-radius:10px; padding:12px; margin-bottom:14px; font-size:13px; }

/* MOBILE */
@media (max-width: 768px) {
  .admin-sidebar { transform:translateX(-100%); width:280px; }
  .admin-sidebar.open { transform:translateX(0); }
  .sidebar-overlay { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:199; }
  .sidebar-overlay.show { display:block; }
  .admin-main { margin-left:0; }
  .menu-toggle { display:block !important; }
  .stats-grid { grid-template-columns:1fr 1fr; gap:10px; }
  .stat-card { padding:12px; }
  .stat-card-value { font-size:24px; }
  .admin-content { padding:12px; }
  .admin-table-wrap { overflow-x:auto; }
  .admin-table th, .admin-table td { padding:8px 10px; font-size:12px; white-space:nowrap; }
  .topbar-right .topbar-time { display:none; }
  .admin-topbar { padding:10px 12px; }
  .page-title { font-size:16px; }
  .filter-bar { padding:8px 12px; }
}

/* Celular: tabelas viram cards (rotulo de cada celula em data-l, preenchido por admin.js) */
@media (max-width: 768px) {
  .admin-table-wrap { background:transparent; border:0; overflow:visible; }
  .admin-table-wrap > .admin-table-header, .admin-table-wrap > .filter-bar { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); margin-bottom:10px; }
  .admin-table thead { display:none; }
  .admin-table, .admin-table tbody, .admin-table tfoot, .admin-table tr, .admin-table td { display:block; width:100%; box-sizing:border-box; }
  .admin-table tr { background:var(--surface); border:1px solid var(--border); border-radius:10px; margin-bottom:10px; padding:8px 12px; }
  .admin-table tfoot tr { background:var(--surface-2); border-color:rgba(34,197,94,.4); }
  .admin-table tr:hover td { background:none; }
  .admin-table td { border:0; padding:5px 0; display:flex; justify-content:space-between; align-items:flex-start; gap:12px; text-align:right; white-space:normal; font-size:13px; overflow-wrap:anywhere; }
  .admin-table td::before { content:attr(data-l); color:var(--text-2); font-size:12px; text-align:left; flex-shrink:0; max-width:48%; }
  .admin-table td[data-l=""]::before, .admin-table td:not([data-l])::before { content:none; }
  .admin-table td[data-l=""], .admin-table td:not([data-l]) { justify-content:flex-end; }
  .admin-table td.first { display:block; text-align:left; font-weight:700; font-size:14px; border-bottom:1px solid var(--border); padding-bottom:6px; margin-bottom:4px; }
  .admin-table td.first::before { content:none; }
  .admin-table td[colspan] { display:block; text-align:center; }
  .admin-table td[colspan]::before { content:none; }
  .admin-table td.adm-act, .admin-table td[data-l=""], .admin-table td[data-l="Ações"], .admin-table td[data-l="Ação"] { flex-wrap:wrap; }
  .admin-table td.adm-act button, .admin-table td[data-l=""] button, .admin-table td[data-l="Ações"] button, .admin-table td[data-l="Ação"] button,
  .admin-table td.adm-act .btn-admin, .admin-table td[data-l="Ações"] .btn-admin { min-height:38px; flex:1 1 110px; justify-content:center; }

  /* REC0106: tabelas .pm-tab, .b-tbl, .wa viram cartões no celular */
  .pm-box { overflow-x:visible !important; }
  table.pm-tab.has-hd thead, table.b-tbl.has-hd thead, table.wa.has-hd thead { display:none; }
  table.pm-tab.has-hd, table.pm-tab.has-hd tbody, table.pm-tab.has-hd tr, table.pm-tab.has-hd td,
  table.b-tbl.has-hd, table.b-tbl.has-hd tbody, table.b-tbl.has-hd tr, table.b-tbl.has-hd td,
  table.wa.has-hd, table.wa.has-hd tbody, table.wa.has-hd tr, table.wa.has-hd td { display:block; width:100%; box-sizing:border-box; }
  table.pm-tab.has-hd tr, table.b-tbl.has-hd tr, table.wa.has-hd tr { background:rgba(11,18,32,.75); border:1px solid var(--border); border-radius:10px; margin-bottom:10px; padding:10px 12px; }
  table.pm-tab.has-hd td, table.b-tbl.has-hd td, table.wa.has-hd td { border:0; border-bottom:1px solid rgba(255,255,255,.06); padding:6px 0; display:flex; justify-content:space-between; align-items:center; gap:10px; text-align:right; white-space:normal !important; font-size:12.5px; overflow-wrap:anywhere; flex-wrap:wrap; }
  table.pm-tab.has-hd td:last-child, table.b-tbl.has-hd td:last-child, table.wa.has-hd td:last-child { border-bottom:0; }
  table.pm-tab.has-hd td::before, table.b-tbl.has-hd td::before, table.wa.has-hd td::before { content:attr(data-l); color:var(--text-2); font-size:11.5px; font-weight:600; text-align:left; flex-shrink:0; max-width:48%; }
  table.pm-tab.has-hd td[data-l=""]::before, table.b-tbl.has-hd td[data-l=""]::before, table.wa.has-hd td[data-l=""]::before { content:none; }
  table.pm-tab.has-hd td.first, table.b-tbl.has-hd td.first, table.wa.has-hd td.first { display:block; text-align:left; font-weight:700; font-size:13.5px; border-bottom:1px solid var(--border); padding-bottom:7px; margin-bottom:4px; }
  table.pm-tab.has-hd td.first::before, table.b-tbl.has-hd td.first::before, table.wa.has-hd td.first::before { content:none; }
  table.pm-tab.has-hd td[colspan], table.b-tbl.has-hd td[colspan], table.wa.has-hd td[colspan] { display:block; text-align:center; }
  table.pm-tab.has-hd td[colspan]::before, table.b-tbl.has-hd td[colspan]::before, table.wa.has-hd td[colspan]::before { content:none; }
  table.pm-tab.has-hd td.adm-act, table.b-tbl.has-hd td.adm-act, table.wa.has-hd td.adm-act { display:flex; gap:8px; padding-top:8px; justify-content:stretch; }
  table.pm-tab.has-hd td.adm-act::before, table.b-tbl.has-hd td.adm-act::before, table.wa.has-hd td.adm-act::before { content:none; }
  table.pm-tab.has-hd td.adm-act button, table.pm-tab.has-hd td.adm-act a.pm-btn,
  table.b-tbl.has-hd td.adm-act button, table.wa.has-hd td.adm-act button { flex:1 1 130px; min-height:40px; justify-content:center; width:100%; }
  table.pm-tab:not(.has-hd), table.pm-tab:not(.has-hd) tbody, table.pm-tab:not(.has-hd) tr, table.pm-tab:not(.has-hd) td { display:block; width:100%; box-sizing:border-box; }
  table.pm-tab:not(.has-hd) tr { border-bottom:1px solid rgba(255,255,255,.08); padding:6px 0; }
  table.pm-tab:not(.has-hd) tr:last-child { border-bottom:0; }
  table.pm-tab:not(.has-hd) td { border:0; padding:2px 0; white-space:normal !important; overflow-wrap:anywhere; text-align:left !important; }
}
@media (max-width: 380px) {
  .stats-grid { grid-template-columns:1fr; }
}

/* Scrollbar */
::-webkit-scrollbar { width:5px; height:5px; }
::-webkit-scrollbar-track { background:var(--bg); }
::-webkit-scrollbar-thumb { background:var(--border); border-radius:3px; }

/* LOGO-TRANSPARENTE */
.sidebar-logo picture{display:flex;align-items:center;line-height:0}
.sidebar-logo-img{height:36px;width:auto;display:block}
.sidebar-logo .logo-text .admin-badge{margin-left:0}
.topbar-logo{display:none;line-height:0}
.topbar-logo img{height:30px;width:auto;display:block}
@media (max-width:768px){.topbar-logo{display:flex;align-items:center;margin-right:4px}.topbar-left .page-title{font-size:15px}}

/* FINANCEIRO / TESTES */
.fin-custom { display:inline-flex; gap:6px; align-items:center; flex-wrap:wrap; }
.fin-toggle { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--text-2); cursor:pointer; min-height:38px; padding:0 4px; user-select:none; }
.fin-toggle input { width:18px; height:18px; accent-color:var(--brand); }
.fin-info { margin:-6px 0 14px; }
.fin-acts { display:flex; gap:6px; flex-wrap:wrap; justify-content:flex-end; }
.gw-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:10px; }
.gw-grid > div { background:var(--surface-2); border-radius:10px; padding:10px 12px; display:flex; flex-direction:column; }
.gw-grid b { font-family:var(--font-num); font-size:24px; line-height:1.15; font-variant-numeric:tabular-nums; }
.dia { margin-bottom:18px; }
.dia-head { display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 14px; background:var(--surface-2); border:1px solid var(--border); border-bottom:0; border-radius:var(--radius) var(--radius) 0 0; padding:10px 14px; }
.dia-tit { font-weight:700; }
.dia-tot { margin-left:auto; font-variant-numeric:tabular-nums; color:var(--text-2); }
.dia-tot b { font-family:var(--font-num); font-size:20px; color:var(--brand); margin-left:2px; }
.dia-split { flex-basis:100%; display:flex; flex-wrap:wrap; gap:6px; }
.dia-split span { font-size:12px; background:var(--surface); border:1px solid var(--border); border-radius:999px; padding:2px 9px; color:var(--text-2); white-space:nowrap; }
.dia .admin-table-wrap { border-radius:0 0 var(--radius) var(--radius); }
.tag-teste { display:inline-block; font-size:10px; font-weight:800; letter-spacing:.6px; background:#3a4256; color:#cbd5e1; border-radius:4px; padding:1px 6px; vertical-align:middle; line-height:1.5; }
.admin-table tr.is-teste td, .admin-table tr.is-teste td a, .admin-table tr.is-teste td .pos, .admin-table tr.is-teste td .neg, .admin-table tr.is-teste td b { color:#7f8aa3 !important; }
.admin-table tr.is-teste td .badge-status { filter:grayscale(1); opacity:.8; }
.badge-falhou { background:rgba(239,68,68,.14); color:#f87171; }
.aviso-teste { background:rgba(148,163,184,.1); border:1px dashed #475569; color:var(--text-2); border-radius:10px; padding:10px 12px; margin-bottom:14px; font-size:13px; }
#painelTeste .admin-table { margin-top:6px; }
@media (max-width:768px) {
  .fin-toolbar .grow { display:none; }
  .fin-toolbar .seg { width:100%; }
  .fin-toolbar .seg button { flex:1 1 30%; padding:8px 6px; }
  .dia-head { border:1px solid var(--border); border-radius:var(--radius); margin-bottom:8px; }
  .dia-tot { margin-left:0; flex-basis:100%; }
  .dia .admin-table-wrap { border-radius:0; }
  .admin-table tr.is-teste { border-style:dashed; background:rgba(18,26,43,.6); }
  .fin-acts { justify-content:flex-end; width:100%; }
}

/* PIX-INCOMPLETO-CARD */
.stat-card[data-clique-dep] { cursor: pointer; transition: all .2s; }
.stat-card[data-clique-dep]:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,.35); }

/* menu2 (14/10/2026): abas de pagina (Dashboard: Resumo | Premios | Desempenho; Risco: Exposicao | Alerta | Compensar) */
.adm-ptabs { display:flex; gap:4px; overflow-x:auto; border-bottom:1px solid var(--border); margin:0 20px; padding-top:10px; max-width:1360px; scrollbar-width:none; }
.adm-ptabs::-webkit-scrollbar { display:none; }
.adm-ptabs a { color:var(--text-2); padding:10px 12px; font-size:13px; font-weight:600; white-space:nowrap; text-decoration:none; border-bottom:2px solid transparent; }
.adm-ptabs a:hover { color:var(--text); }
.adm-ptabs a.on { color:var(--brand); border-bottom-color:var(--brand); }
@media (max-width:768px) { .adm-ptabs { margin:0 12px; } }

/* ===== MODO COMPUTADOR (admin-desk) - ligado pelo botao "Modo computador" na barra superior; so vale em telas >= 1100px ===== */
.desk-toggle { display:none; }
@media (min-width:1100px) {
  .desk-toggle { display:inline-flex; align-items:center; gap:6px; background:transparent; border:1px solid var(--border); color:var(--text-2); padding:5px 10px; border-radius:8px; font-size:12px; font-weight:600; cursor:pointer; }
  .desk-toggle:hover { border-color:var(--brand); color:var(--brand); }
  html.desk .desk-toggle { background:rgba(34,197,94,.14); border-color:var(--brand); color:var(--brand); }
  html.desk body.admin-body { font-size:13px; line-height:1.35; }
  html.desk .admin-sidebar { width:196px; }
  html.desk .admin-main { margin-left:196px; }
  html.desk .sidebar-logo { padding:10px 12px; }
  html.desk .nav-item { padding:7px 12px; font-size:13px; }
  html.desk .nav-section-title { padding:8px 12px 2px; }
  html.desk .admin-topbar { padding:6px 16px; }
  html.desk .page-title { font-size:15px; }
  html.desk .adm-ptabs { margin:0 16px; padding-top:4px; max-width:none; }
  html.desk .admin-content { padding:10px 16px; max-width:none; }
  html.desk .stats-grid { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:8px; margin-bottom:10px; }
  html.desk .stat-card { padding:9px 12px; }
  html.desk .stat-card-icon { width:26px; height:26px; font-size:12px; margin-bottom:4px; }
  html.desk .stat-card-value { font-size:22px; margin:2px 0 0; }
  html.desk .stat-card-label { font-size:10px; }
  html.desk .stat-card-sub { font-size:11px; }
  html.desk .admin-table-wrap { margin-bottom:10px; }
  html.desk .admin-table-header { padding:8px 12px; }
  html.desk .admin-table-title { font-size:13px; }
  html.desk .admin-table th { padding:6px 10px; font-size:10px; }
  html.desk .admin-table td { padding:5px 10px; font-size:12px; }
  html.desk .filter-bar { padding:8px 12px; }
  html.desk .filter-input, html.desk .filter-select { min-height:32px; padding:5px 9px; font-size:13px; }
  html.desk .btn-admin { min-height:32px; padding:6px 12px; }
  html.desk .btn-admin.sm { min-height:26px; padding:3px 8px; }
  html.desk .casa-card { padding:10px 12px; }
  html.desk .casa-card .val { font-size:20px; margin:3px 0 2px; }
  html.desk .casa-card.big .val { font-size:28px; }
  html.desk .casa-card .sub { font-size:12px; line-height:1.35; }
  html.desk .casa-grid { gap:8px; margin-bottom:0; }
  html.desk .panel { margin-bottom:0; }
  /* Dashboard (index): blocos lado a lado, dados principais no topo */
  html.desk #mainContent:has(#casaCards) { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:10px 12px; align-items:start; }
  html.desk #mainContent:has(#casaCards) > * { grid-column:1 / -1; min-width:0; margin-bottom:0; }
  html.desk #mainContent:has(#casaCards) > #filaAcao { order:0; }
  html.desk #mainContent:has(#casaCards) > .casa-sel { order:1; grid-column:1 / span 8; margin-bottom:0; }
  html.desk #mainContent:has(#casaCards) > .casa-nav { order:1; grid-column:9 / -1; margin-bottom:0; justify-content:flex-end; }
  html.desk #mainContent:has(#casaCards) > .casa-nav .casa-rot { font-size:14px; min-width:120px; }
  html.desk #mainContent:has(#casaCards) > #casaErr, html.desk #mainContent:has(#casaCards) > #dashErr { order:2; }
  html.desk #mainContent:has(#casaCards) > #casaCards { order:3; }
  html.desk #mainContent:has(#casaCards) > #cards { order:4; }
  html.desk #mainContent:has(#casaCards) > #alertasRetorno { order:5; grid-column:1 / span 6; }
  html.desk #mainContent:has(#casaCards) > #topResultados { order:5; grid-column:7 / -1; }
  html.desk #mainContent:has(#casaCards) > #probCard { order:6; }
  html.desk #mainContent:has(#casaCards) > #casaChartBox { order:7; grid-column:1 / span 6; }
  html.desk #mainContent:has(#casaCards) > .panel { order:7; grid-column:7 / -1; }
  html.desk #mainContent:has(#casaCards) > .admin-table-wrap:has(#casaTab) { order:8; grid-column:1 / span 6; }
  html.desk #mainContent:has(#casaCards) > .admin-table-wrap:has(#tabDias) { order:8; grid-column:7 / -1; }
  html.desk #mainContent:has(#casaCards) > p.muted { order:9; }
}

/* ===== ONLINE-LADO (20/10/2026): painel fixo a direita com os clientes logados agora; so em tela de computador (>= 1280px) ===== */
.adm-onl-side { display:none; }
@media (min-width:1280px) {
  html.onl-side .admin-main { margin-right:232px; }
  html.onl-side .adm-onl-side { display:flex; flex-direction:column; position:fixed; right:0; top:0; bottom:0; width:232px; background:var(--bg-sidebar); border-left:1px solid var(--border); z-index:150; }
  .adm-onl-side .h { display:flex; align-items:center; gap:8px; padding:13px 14px; border-bottom:1px solid var(--border); font-size:11px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:var(--text-2); }
  .adm-onl-side .h b { margin-left:auto; font-family:var(--font-num); font-size:18px; color:var(--text); letter-spacing:0; }
  .adm-onl-side .adm-online-dot { width:8px; height:8px; border-radius:50%; background:#22c55e; box-shadow:0 0 0 3px rgba(34,197,94,.18); flex:none; }
  .adm-onl-side .lst { flex:1; overflow-y:auto; padding:4px 0; }
  .adm-onl-side .u { display:block; padding:7px 14px 7px 11px; text-decoration:none; color:var(--text); border-left:3px solid transparent; }
  .adm-onl-side .u:hover { background:var(--surface); border-left-color:var(--brand); }
  .adm-onl-side .u .n { display:flex; align-items:center; gap:7px; font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .adm-onl-side .u .n::before { content:''; width:6px; height:6px; border-radius:50%; background:#22c55e; flex:none; }
  .adm-onl-side .u .p { margin-left:13px; font-size:11px; color:var(--text-2); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .adm-onl-side .vz { padding:14px; font-size:12px; color:var(--text-2); }
  .adm-onl-side .rod { padding:10px 14px; border-top:1px solid var(--border); font-size:11px; color:var(--text-2); line-height:1.6; }
  .adm-onl-side .rod b { color:var(--text); }
}
/* UNICOS-DIA: pessoas diferentes hoje no rodape do painel lateral */
@media (min-width:1280px) {
  .adm-onl-side .rod .uq { display:grid; grid-template-columns:1fr auto; align-items:baseline; gap:0 8px; margin-bottom:6px; padding:8px 10px; background:rgba(34,197,94,.08); border:1px solid rgba(34,197,94,.35); border-radius:8px; }
  .adm-onl-side .rod .uq span { font-size:11px; color:var(--text-2); }
  .adm-onl-side .rod .uq b { font-family:var(--font-num); font-size:22px; color:var(--brand); line-height:1; }
  .adm-onl-side .rod .uq small { grid-column:1 / -1; font-size:10.5px; color:var(--text-2); }
}


/* ═══ ETAPA 1: MENU 6 SEÇÕES RECOLHÍVEIS + BARRA FIXA CELULAR + CABEÇALHO COMPACTO ═══ */
.adm-nav-sec { border-bottom: 1px solid rgba(34, 48, 77, 0.45); }
.adm-nav-sec > summary.nav-section-title {
  list-style: none; cursor: pointer; user-select: none; -webkit-user-select: none;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; font-size: 11px; font-weight: 700; letter-spacing: 1px;
  color: var(--text-2); opacity: 0.9; text-transform: uppercase; transition: background .15s, color .15s;
}
.adm-nav-sec > summary.nav-section-title::-webkit-details-marker { display: none; }
.adm-nav-sec > summary.nav-section-title:hover { background: rgba(24, 34, 58, 0.55); color: var(--text); }
.adm-nav-sec .sec-left { display: inline-flex; align-items: center; gap: 8px; }
.adm-nav-sec .sec-left i { width: 16px; text-align: center; font-size: 12px; color: var(--brand); opacity: 0.85; }
.adm-nav-sec .sec-right { display: inline-flex; align-items: center; gap: 6px; }
.adm-nav-sec .sec-chev { font-size: 10px; transition: transform .2s ease; opacity: 0.65; }
.adm-nav-sec[open] .sec-chev { transform: rotate(180deg); }
.adm-nav-sec[open] .sec-badge { display: none !important; }
.adm-nav-sec .sec-badge {
  background: var(--red); color: #fff; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 999px; line-height: 1.3;
}
.adm-nav-items { padding: 2px 0 8px; }
.adm-nav-items .nav-item { padding: 9px 16px 9px 24px; font-size: 13.5px; border-radius: 0; }
.adm-nav-items .nav-item i { color: var(--text-2); transition: color .15s; }
.adm-nav-items .nav-item.active i, .adm-nav-items .nav-item:hover i { color: var(--brand); }

/* Indicador compacto no topo ("atualizado há X min ↻") */
.adm-sync-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(24, 34, 58, 0.75); border: 1px solid var(--border);
  border-radius: 999px; padding: 4px 10px; font-size: 11.5px; font-weight: 500;
  color: var(--text-2); cursor: pointer; white-space: nowrap; transition: all .15s;
  min-height: 28px;
}
.adm-sync-pill:hover { border-color: var(--brand); color: var(--text); }
.adm-sync-pill:disabled { opacity: 0.55; cursor: wait; }
.adm-sync-pill i { font-size: 11px; color: var(--brand); }
.adm-sync-pill.spinning i { animation: admSpin 0.9s linear infinite; }
@keyframes admSpin { to { transform: rotate(360deg); } }

/* Rodapé discreto para Dias de Site e Consumo do Firestore */
#cotaBar.adm-cota-footer {
  margin: 28px 0 12px !important; padding-top: 14px;
  border-top: 1px solid rgba(34, 48, 77, 0.6); opacity: 0.85;
}

/* Barra fixa embaixo no celular (iPhone): 5 atalhos */
.adm-bottom-nav { display: none; }
@media (max-width: 768px) {
  body.admin-body { padding-bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }
  .adm-bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 210;
    background: rgba(10, 15, 29, 0.96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.45);
  }
  .adm-bn-item {
    position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 4px 2px; color: var(--text-2); text-decoration: none;
    font-size: 10.5px; font-weight: 600; border: 0; background: none; cursor: pointer;
    min-height: 48px; border-radius: 8px; transition: color .15s;
  }
  .adm-bn-item i { font-size: 17px; line-height: 1; }
  .adm-bn-item.active { color: var(--brand); }
  .adm-bn-item .bb-badge {
    position: absolute; top: 2px; right: calc(50% - 18px);
    background: var(--red); color: #fff; font-size: 9.5px; font-weight: 800;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    display: none; align-items: center; justify-content: center;
    border: 1.5px solid #0a0f1d;
  }
  /* Esconde elementos secundários no topo do iPhone para caber o título + Online + Sync */
  .topbar-right .admin-profile, .topbar-right .desk-toggle { display: none !important; }
  .admin-topbar { padding: 8px 10px; gap: 6px; }
  .topbar-right { gap: 6px; }
  .adm-sync-pill { padding: 3px 8px; font-size: 11px; }
}


/* ═══ ETAPA 2 & 3: SINO DE ALERTAS, TOAST 8S, DASHBOARD CARDS 1-LINHA, GAVETA DE FILTROS, MENU ⋯ E ESQUELETOS ═══ */

/* 1. Sino de alertas no cabeçalho + Toast no canto (nunca cobre cabeçalho nem barra inferior) */
.adm-bell-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 999px; background: rgba(24, 34, 58, 0.75);
  border: 1px solid var(--border); color: var(--text-2); cursor: pointer; font-size: 14px;
  transition: border-color .15s, color .15s, background .15s; flex-shrink: 0;
}
.adm-bell-btn:hover, .adm-bell-btn.has-alert { color: #fff; border-color: rgba(239, 68, 68, 0.6); }
.adm-bell-btn.has-alert { background: rgba(239, 68, 68, 0.16); color: #f87171; }
.adm-bell-badge {
  position: absolute; top: -4px; right: -4px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg); line-height: 1;
}

.adm-cmp-toast {
  position: fixed; top: 64px; right: 12px; width: calc(100vw - 24px); max-width: 360px;
  z-index: 950; background: #1e1118; border: 1px solid #ef4444; color: #fff;
  border-radius: 12px; padding: 12px 36px 12px 14px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.65); font-size: 13px; line-height: 1.4;
  animation: admToastIn .22s ease-out;
}
@media (max-width: 768px) {
  .adm-cmp-toast { top: 60px; bottom: auto; max-height: calc(100vh - 140px); overflow-y: auto; }
}
@keyframes admToastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.adm-cmp-toast .toast-x {
  position: absolute; top: 8px; right: 8px; background: transparent; border: 0;
  color: #fca5a5; font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.adm-cmp-toast .toast-bar {
  height: 3px; background: #ef4444; border-radius: 2px; margin-top: 8px;
  animation: admToastTimer 8s linear forwards;
}
@keyframes admToastTimer { from { width: 100%; } to { width: 0%; } }

/* 2. Esqueletos animados (Skeleton Loaders) */
@keyframes admShimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.adm-skel {
  display: block; border-radius: 8px; height: 14px; margin: 6px 0;
  background: linear-gradient(90deg, rgba(30,41,59,.65) 25%, rgba(51,65,85,.85) 50%, rgba(30,41,59,.65) 75%);
  background-size: 200% 100%; animation: admShimmer 1.35s infinite linear;
}
.adm-skel-lg { height: 28px; width: 62%; border-radius: 8px; margin: 8px 0; }
.adm-skel-md { height: 16px; width: 80%; }
.adm-skel-sm { height: 12px; width: 45%; }
.adm-skel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; width: 100%; }
.adm-skel-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px;
}
/* Qualquer .admin-loading mostra esqueleto animado elegante em vez de spinner + "Carregando..." */
.admin-loading {
  padding: 20px 16px !important; align-items: stretch !important; justify-content: flex-start !important;
  color: transparent !important; font-size: 0 !important; gap: 10px !important;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px; margin-bottom: 12px;
}
.admin-loading i { display: none !important; }
.admin-loading::before {
  content: ''; display: block; height: 22px; width: 55%; border-radius: 8px;
  background: linear-gradient(90deg, rgba(30,41,59,.65) 25%, rgba(51,65,85,.85) 50%, rgba(30,41,59,.65) 75%);
  background-size: 200% 100%; animation: admShimmer 1.35s infinite linear;
}
.admin-loading::after {
  content: ''; display: block; height: 14px; width: 85%; border-radius: 8px;
  background: linear-gradient(90deg, rgba(30,41,59,.65) 25%, rgba(51,65,85,.85) 50%, rgba(30,41,59,.65) 75%);
  background-size: 200% 100%; animation: admShimmer 1.35s infinite linear;
}

/* 3. Cards do Dashboard: valor grande em UMA linha + seta ↑↓ % + ver detalhes + mini-gráfico 7d */
.casa-card {
  background: var(--surface, #121a2b); border: 1px solid var(--border, #22304d);
  border-radius: 12px; padding: 16px; min-width: 0; display: flex; flex-direction: column; justify-content: space-between;
}
.casa-card .lbl {
  font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-2, #94a3b8); display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.casa-card .val-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 6px 0 4px; min-width: 0;
}
.casa-card .val, .casa-card.big .val {
  font-size: clamp(20px, 5.2vw, 28px) !important; font-weight: 800; line-height: 1.15;
  white-space: nowrap !important; word-break: normal !important; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; margin: 0; flex-shrink: 1; min-width: 0;
}
.casa-var {
  display: inline-flex; align-items: center; gap: 3px; font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
  background: rgba(148, 163, 184, 0.12); color: var(--text-2);
}
.casa-var.pos { background: rgba(34, 197, 94, 0.15); color: #22c55e; }
.casa-var.neg { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.casa-mini7 {
  margin: 8px 0 4px; padding-top: 6px; border-top: 1px solid rgba(34, 48, 77, 0.45);
}
.casa-mini7-hd {
  display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); margin-bottom: 4px;
}
.casa-mini7 svg { width: 100%; height: 46px; display: block; overflow: visible; }
.casa-det {
  margin-top: 8px; border-top: 1px solid rgba(34, 48, 77, 0.45); padding-top: 6px;
}
.casa-det > summary {
  list-style: none; cursor: pointer; user-select: none; font-size: 12px; font-weight: 600;
  color: var(--brand); display: inline-flex; align-items: center; gap: 5px;
}
.casa-det > summary::-webkit-details-marker { display: none; }
.casa-det > summary i { font-size: 10px; transition: transform .2s; }
.casa-det[open] > summary i { transform: rotate(180deg); }
.casa-det-body { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-2); }
.casa-det-body b { color: var(--text); }

/* 4. Barra de busca fixa no topo + Botão Filtros (gaveta de baixo para cima) + Menu "⋯" */
.adm-sticky-bar {
  position: sticky; top: 53px; z-index: 95; background: rgba(11, 16, 32, 0.96);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
  margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.adm-sticky-bar .filter-input[type="search"], .adm-sticky-bar .adm-search-inp {
  flex: 1 1 auto; min-width: 0 !important; width: 100%; height: 38px; min-height: 38px;
  padding: 6px 12px; font-size: 14px; border-radius: 8px;
}
.adm-flt-btn {
  position: relative; flex-shrink: 0; padding: 0 12px !important; height: 38px; min-height: 38px !important;
  border-radius: 8px; white-space: nowrap;
}
.adm-flt-badge {
  background: var(--brand); color: #04220f; font-size: 10px; font-weight: 800;
  padding: 1px 6px; border-radius: 999px; margin-left: 2px;
}
.adm-more-wrap { position: relative; flex-shrink: 0; }
.adm-more-btn {
  width: 38px; height: 38px; min-height: 38px !important; padding: 0 !important;
  border-radius: 8px; font-size: 16px;
}
.adm-more-pop {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 250;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 8px; min-width: 230px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.65);
  flex-direction: column; gap: 6px;
}
.adm-more-pop.open { display: flex; }
.adm-more-pop .btn-admin {
  width: 100%; justify-content: flex-start; text-align: left; font-size: 13px; padding: 9px 12px;
}

/* Gaveta (bottom-up drawer) de filtros */
.adm-drawer-ov {
  display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65);
  z-index: 2100; align-items: flex-end; justify-content: center;
}
.adm-drawer-ov.open { display: flex; }
.adm-drawer {
  background: var(--surface); border-top: 1px solid var(--border);
  border-radius: 18px 18px 0 0; width: 100%; max-width: 560px;
  max-height: 85vh; overflow-y: auto; padding: 16px 16px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.6);
  animation: admDrawerUp .2s ease-out;
}
@media (min-width: 768px) {
  .adm-drawer-ov { align-items: center; }
  .adm-drawer { border-radius: 16px; border: 1px solid var(--border); padding: 20px; }
}
@keyframes admDrawerUp { from { transform: translateY(40px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.adm-drawer-handle {
  width: 40px; height: 4px; border-radius: 999px; background: rgba(148, 163, 184, 0.35);
  margin: 0 auto 12px;
}
.adm-drawer-hd {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.adm-drawer-hd h3 { font-size: 16px; font-weight: 700; margin: 0; display: flex; align-items: center; gap: 8px; }
.adm-drawer-body { display: flex; flex-direction: column; gap: 12px; }
.adm-drawer-field label {
  display: block; font-size: 12px; font-weight: 700; color: var(--text-2);
  margin-bottom: 5px; text-transform: uppercase; letter-spacing: .04em;
}
.adm-drawer-field .filter-select, .adm-drawer-field .filter-input { width: 100%; }
.adm-drawer-ft {
  display: flex; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border);
}
.adm-drawer-ft .btn-admin { flex: 1; min-height: 42px; font-size: 14px; }


/* ═══ FIX IPHONE 390PX: NUNCA ESTOURAR LARGURA DA TELA (MINMAX(0,1FR) + FLEX 1 1 0%) ═══ */
html, body.admin-body {
  max-width: 100vw; overflow-x: clip; box-sizing: border-box;
}
.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
}
.stat-card, .casa-card, .fa-item, .fa-info {
  min-width: 0; max-width: 100%; box-sizing: border-box;
}
.stat-card-value {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.adm-sticky-bar {
  width: 100%; max-width: 100%; box-sizing: border-box;
}
.adm-sticky-bar .filter-input[type="search"], .adm-sticky-bar .adm-search-inp {
  width: 0 !important; min-width: 0 !important; flex: 1 1 0% !important;
}
@media (max-width: 768px) {
  .admin-topbar { padding: 8px 10px; gap: 6px; max-width: 100vw; box-sizing: border-box; }
  .topbar-left { min-width: 0; flex: 1 1 auto; overflow: hidden; }
  .topbar-left .page-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 15px; }
  .topbar-right { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
  .adm-sync-pill { padding: 4px 8px; font-size: 11px; gap: 4px; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .stat-card { padding: 10px 11px; }
  .stat-card-value { font-size: clamp(16px, 4.5vw, 21px) !important; }
  .stat-card-label { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .stat-card-sub { font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
  .fa-item { flex-wrap: wrap; }
  .fa-acts { width: 100%; justify-content: flex-end; margin-top: 4px; }
}

/* ═══ REVISAO ETAPAS 2 & 3 (20/10/2026): ABAS, TOPBAR, SAQUES 1-COL, INFO POPOVER, CARDS INTER ═══ */

/* 1. Padrão unificado de cards (.casa-card) em todas as abas do Dashboard:
   Fonte Inter, valor grande em UMA linha (nunca quebrar), sem bordas coloridas grossas */
.casa-grid {
  display: grid; grid-template-columns: 1fr; gap: 12px; margin-bottom: 16px;
}
@media (min-width: 700px) { .casa-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1120px) {
  .casa-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .casa-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.casa-card {
  background: var(--surface, #121a2b) !important;
  border: 1px solid var(--border, #22304d) !important;
  border-left: 1px solid var(--border, #22304d) !important;
  border-radius: 12px !important;
  padding: 15px 16px !important;
  min-width: 0; max-width: 100%; box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}
.casa-card .lbl {
  font-family: 'Inter', sans-serif !important;
  font-size: 11.5px !important; font-weight: 700 !important;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-2, #94a3b8);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-width: 0;
}
.casa-card .lbl > span:first-child {
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0;
}
.casa-card .val-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin: 6px 0 2px; min-width: 0;
}
.casa-card .val, .casa-card.big .val {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
  font-size: clamp(18px, 4.6vw, 24px) !important;
  font-weight: 800 !important;
  line-height: 1.2 !important;
  letter-spacing: -0.02em !important;
  white-space: nowrap !important;
  word-break: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  font-variant-numeric: tabular-nums;
  margin: 0 !important;
  min-width: 0; max-width: 100%;
}
.casa-card .val.pos { color: #22c55e !important; }
.casa-card .val.neg { color: #ef4444 !important; }
.casa-card .val.neu { color: var(--text, #e5e7eb) !important; }

/* Seletor de período padronizado nas abas */
.casa-sel { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.casa-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.casa-rot { font-weight: 700; font-size: 15px; min-width: 140px; text-align: center; }

/* 2. Barra de abas (.adm-ptabs): sublinhado verde na aba ativa + degradê nas bordas indicando rolagem */
.adm-ptabs {
  position: relative;
  display: flex; gap: 2px; overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin: 0 20px; padding-top: 8px; max-width: 1360px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
}
.adm-ptabs::-webkit-scrollbar { display: none; }
.adm-ptabs a {
  color: var(--text-2); padding: 10px 13px; font-size: 13px; font-weight: 600;
  white-space: nowrap; text-decoration: none;
  border-bottom: 2.5px solid transparent;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}
.adm-ptabs a:hover { color: var(--text); }
.adm-ptabs a.on {
  color: var(--brand, #22c55e) !important;
  border-bottom-color: var(--brand, #22c55e) !important;
  font-weight: 700 !important;
}
@media (max-width: 768px) {
  .adm-ptabs {
    margin: 0 10px;
    padding-right: 28px;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 calc(100% - 32px), transparent 100%);
  }
  .adm-ptabs.scrolled-end {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 24px, #000 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 24px, #000 100%);
  }
  .adm-ptabs.scrolled-mid {
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 20px, #000 calc(100% - 28px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 20px, #000 calc(100% - 28px), transparent 100%);
  }
}

/* 3. Cabeçalho no celular: separar sino e logo, evitar sobreposição */
@media (max-width: 768px) {
  .admin-topbar {
    padding: 8px 10px !important;
    gap: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
  }
  .topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    min-width: 0 !important;
    flex: 1 1 auto !important;
    overflow: hidden !important;
  }
  .topbar-left .menu-toggle {
    flex-shrink: 0 !important;
    min-width: 34px !important;
    min-height: 34px !important;
    padding: 4px !important;
  }
  .topbar-left .topbar-logo {
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    margin-right: 2px !important;
  }
  .topbar-left .topbar-logo img {
    height: 24px !important;
    width: auto !important;
    display: block !important;
  }
  .topbar-left .page-title {
    font-size: 14px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    min-width: 0 !important;
  }
  .topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }
  .adm-busca { margin-right: 0 !important; }
  .adm-busca-btn {
    min-width: 32px !important; min-height: 32px !important;
    padding: 4px 6px !important; font-size: 15px !important;
  }
  .adm-bell-btn {
    width: 32px !important; height: 32px !important; font-size: 13px !important;
    margin-left: 2px !important; flex-shrink: 0 !important;
  }
  .adm-sync-pill {
    padding: 3px 7px !important; font-size: 10.5px !important;
    min-height: 26px !important; gap: 4px !important;
  }
  .adm-online {
    padding: 3px 7px !important; font-size: 11px !important;
  }
  .adm-online .adm-online-lb {
    display: none !important;
  }
  /* 4. Saques: 1 card por linha no celular para não cortar "Balanço de hoje" nem "Pendentes aguardando caixa" */
  #caixaBox .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }
  #caixaBox .stat-card-label {
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    font-size: 11.5px !important;
  }
}

/* 5. Botão "ⓘ" discreto para explicações longas (Resumo / Desempenho / etc.) */
.adm-info-pop {
  margin: -4px 0 14px;
}
.adm-info-pop > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--text-2, #94a3b8);
  background: rgba(24, 34, 58, 0.6); border: 1px solid var(--border, #22304d);
  border-radius: 999px; padding: 4px 11px; transition: border-color .15s, color .15s;
}
.adm-info-pop > summary::-webkit-details-marker { display: none; }
.adm-info-pop > summary:hover, .adm-info-pop[open] > summary {
  color: var(--brand, #22c55e); border-color: rgba(34, 197, 94, 0.5);
}
.adm-info-pop > summary .info-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(148, 163, 184, 0.18); color: var(--text, #e5e7eb);
  font-size: 11px; font-weight: 800; font-style: normal; line-height: 1;
}
.adm-info-pop-body {
  margin-top: 8px; padding: 10px 12px;
  background: var(--surface, #121a2b); border: 1px solid var(--border, #22304d);
  border-radius: 10px; font-size: 12px; line-height: 1.5; color: var(--text-2, #94a3b8);
}

/* Fix FontAwesome 6 conflito de classes .fa-n ("N1") e .fa-tit / .fa-item ("[]") */
.fa-item::before, .fa-info::before, .fa-tit::before, .fa-acts::before, .fa-n::before {
  content: none !important;
  display: none !important;
}
.adm-busca-btn {
  background: rgba(24, 34, 58, 0.75) !important;
  border: 1px solid var(--border, #22304d) !important;
  color: var(--text-2, #94a3b8) !important;
  border-radius: 999px !important;
  width: 32px !important; height: 32px !important;
  min-width: 32px !important; min-height: 32px !important;
  display: inline-flex !important; align-items: center !important; justify-content: center !important;
  padding: 0 !important; cursor: pointer;
}
@media (max-width: 768px) {
  .topbar-left .topbar-logo img { height: 22px !important; }
  .topbar-left .page-title { font-size: 13.5px !important; }
  #caixaBox .stat-card {
    padding: 12px 14px !important;
    display: grid !important;
    grid-template-columns: 1fr auto !important;
    align-items: center !important;
    gap: 2px 10px !important;
  }
  #caixaBox .stat-card-icon {
    grid-column: 2 !important;
    grid-row: 1 / span 2 !important;
    margin-bottom: 0 !important;
    width: 34px !important; height: 34px !important; font-size: 15px !important;
  }
  #caixaBox .stat-card-label, #caixaBox .stat-card-value, #caixaBox .stat-card-sub {
    grid-column: 1 !important;
  }
}

/* === REV3: Hide truncated page title in mobile header (active tab already shows page) === */
@media (max-width: 768px) {
  .topbar-left .page-title {
    display: none !important;
  }
}

/* === ADM-N2 (admin próximo nível): Aguardando ação compacto + Ações rápidas === */
.fila-acao.fq-compacta { padding: 12px 14px; }
.fila-acao.fq-compacta h3 { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; margin-bottom: 8px; white-space: nowrap; }
.fq-rod { display: flex; gap: 8px; margin-top: 8px; }
.fq-rod > * { flex: 1 1 0; min-width: 0; margin-top: 0 !important; }
.fq-todos { background: none; border: 1px solid rgba(34,197,94,.45); border-radius: 10px; color: var(--brand); font-size: 12.5px; font-weight: 600; cursor: pointer; padding: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) { .fq-chev, .fq-ver { display: none; } .fq-lin { gap: 7px; } }
.fq-grp + .fq-grp { margin-top: 6px; }
.fq-lin { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 8px 6px 10px; border: 1px solid var(--border); border-left: 3px solid var(--fq-cor, var(--blue)); border-radius: 10px; background: var(--surface-2); cursor: pointer; user-select: none; }
.fq-lin:hover { border-color: #2d3f63; border-left-color: var(--fq-cor, var(--blue)); }
.fq-lin:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.fq-ic { width: 22px; flex: 0 0 22px; text-align: center; color: var(--fq-cor, var(--blue)); font-size: 14px; }
.fq-t { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; font-size: 13px; }
.fq-v { flex: 0 0 auto; white-space: nowrap; font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums; }
.fq-ver { color: var(--text-2); font-weight: 500; font-size: 12px; text-decoration: underline; }
.fq-b { flex: 0 0 auto; white-space: nowrap; min-height: 32px !important; padding: 4px 10px !important; font-size: 12px !important; }
.fq-ok { width: 34px; min-width: 34px; padding: 0 !important; justify-content: center; }
.fq-chev { flex: 0 0 auto; color: var(--text-2); font-size: 11px; transition: transform .2s; }
.fq-grp.aberto .fq-chev { transform: rotate(180deg); }
.fq-det { padding: 2px 0 4px 6px; }
.fq-det .fa-item { margin-top: 6px !important; }
.fila-acao .fa-item.fq-sub { flex-wrap: nowrap; padding: 6px 8px 6px 10px; border-left: 3px solid #ef4444; gap: 8px; }
.fila-acao .fa-item.fq-sub .fa-info { flex: 1 1 auto; }
.fila-acao .fa-item.fq-sub .fa-tit { font-weight: 600; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fila-acao .fa-item.fq-sub .fa-acts { width: auto !important; flex-wrap: nowrap; }
.fila-acao .fa-item.fq-sub .fa-acts .btn-admin { flex: 0 0 auto !important; min-height: 32px !important; }
.fq-txt { margin-top: 6px; }
.fq-mais { display: block; width: 100%; margin-top: 8px; padding: 8px; background: none; border: 1px dashed var(--border); border-radius: 10px; color: var(--text-2); font-size: 12.5px; font-weight: 600; cursor: pointer; }
.fq-mais:hover { color: var(--text); }

.qa-wrap { margin: 0 0 12px; }
.qa-tit { font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--text-2); margin: 0 0 8px; }
.qa-tit i { color: var(--gold); }
.qa-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.qa-grid .qa-bt:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 900px) { .qa-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } .qa-grid .qa-bt:last-child:nth-child(odd) { grid-column: auto; } }
.qa-bt { display: flex; align-items: center; gap: 10px; min-height: 60px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); color: var(--text); text-decoration: none; cursor: pointer; text-align: left; font: inherit; min-width: 0; transition: border-color .15s, transform .05s; }
.qa-bt:hover { border-color: #2d3f63; }
.qa-bt:active { transform: scale(.98); }
.qa-bt:disabled { opacity: .6; cursor: wait; }
.qa-ic { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.qa-txt { display: flex; flex-direction: column; min-width: 0; }
.qa-t { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qa-s { font-size: 11.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.qa-li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.qa-li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qa-li b { white-space: nowrap; }
.qa-jogos { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.qa-jogo { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; padding: 9px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; color: var(--text); cursor: pointer; text-align: left; font: inherit; }
.qa-jogo:hover { border-color: var(--gold); }
.qa-jt { font-weight: 700; font-size: 13px; }
.qa-jl { font-size: 11.5px; color: var(--text-2); }

/* ADM-N2 padrão geral: seletores de período numa linha só, números sem quebra */
.seg { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.seg::-webkit-scrollbar { display: none; }
.seg button { white-space: nowrap; flex: 0 0 auto; }
.admin-table td.n, .admin-table th.n, .stat-card-value { white-space: nowrap; }
@media (max-width:768px) {
  .fin-toolbar .seg button { flex: 1 0 auto; padding: 8px 8px; }
}
@media (max-width:480px) {
  .seg button { padding: 8px 7px; font-size: 12px; }
}

/* === TOPO-V2 (01/11/2026): topo do admin sem titulo cortado ("D..") e sem botoes sobrepostos (desktop) === */
@media (min-width: 769px) {
  .admin-topbar { flex-wrap: wrap !important; gap: 6px 12px !important; align-items: center !important; }
  .admin-topbar .topbar-left { flex: 1 1 280px !important; min-width: 240px !important; overflow: visible !important; }
  .admin-topbar .topbar-left .page-title { overflow: visible !important; text-overflow: clip !important; white-space: normal !important; line-height: 1.2 !important; min-width: 0 !important; }
  .admin-topbar .topbar-right { flex: 0 1 auto !important; flex-wrap: wrap !important; justify-content: flex-end !important; margin-left: auto !important; row-gap: 6px !important; max-width: 100% !important; }
  .admin-topbar .topbar-right > * { flex-shrink: 0 !important; position: static !important; }
}
