/* Sistema Staff v16.5 - componentes compartilhados
   Menu, FABs, PWA e controles reutilizáveis. Carregado após base.css. */


/* v16.5 - bloqueio visual imediato no pós-login.
   route-guard.js adiciona classes no <html> ainda no <head>;
   isso impede que Admin/Corridas pisquem antes da tela "Validando acesso". */
html[data-css-mode="modular"].rcp-route-pending body,
html[data-css-mode="modular"].rcp-post-login-validating body{
  min-height:100vh!important;
  overflow:hidden!important;
}
html[data-css-mode="modular"].rcp-route-pending body > *:not(.rcp-guard-preloader),
html[data-css-mode="modular"].rcp-post-login-validating body > *:not(.rcp-guard-preloader),
html[data-css-mode="modular"] body.auth-checking > *:not(.rcp-guard-preloader){
  visibility:hidden!important;
  pointer-events:none!important;
}
html[data-css-mode="modular"].rcp-post-login-validating body::before,
html[data-css-mode="modular"].rcp-route-pending body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:2147482400;
  background:linear-gradient(135deg,rgba(232,249,246,.98),rgba(240,244,255,.98));
}
html[data-css-mode="modular"].rcp-post-login-validating body::after,
html[data-css-mode="modular"].rcp-route-pending body::after{
  content:"Validando acesso";
  position:fixed;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  z-index:2147482401;
  color:#0f172a;
  font-weight:950;
  font-size:22px;
  letter-spacing:-.03em;
  padding:18px 22px;
  border-radius:24px;
  background:rgba(255,255,255,.86);
  border:1px solid rgba(226,232,240,.86);
  box-shadow:0 24px 60px rgba(15,23,42,.16);
}
html[data-css-mode="modular"] body.auth-checking::before,
html[data-css-mode="modular"] body.auth-checking::after,
html[data-css-mode="modular"] body.rcp-page-loading::before,
html[data-css-mode="modular"] body.rcp-page-loading::after{
  content:none!important;
  display:none!important;
}

/* v16.5 - blocos legados do card logado removidos dos HTMLs; esta trava evita flash caso algum volte. */
html[data-css-mode="modular"] body .admin-card-acoes-logado,
html[data-css-mode="modular"] body .acoes-staff.admin-card-acoes-logado{
  display:none!important;
}

:root{--rcp-fab-size:54px;--rcp-fab-bottom:18px;--rcp-fab-right-1:14px;--rcp-fab-right-2:72px;--rcp-fab-right-3:130px;}

/* FABs: posição única desde o primeiro render. Evita "pulo" causado por regras antigas. */
html body .floating-calendar-btn,
html body .floating-yescom-btn,
html body .floating-maintenance-btn{
  position:fixed!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:var(--rcp-fab-size)!important;
  height:var(--rcp-fab-size)!important;
  min-width:var(--rcp-fab-size)!important;
  min-height:var(--rcp-fab-size)!important;
  max-width:var(--rcp-fab-size)!important;
  max-height:var(--rcp-fab-size)!important;
  padding:0!important;
  border-radius:999px!important;
  box-sizing:border-box!important;
  bottom:calc(var(--rcp-fab-bottom) + var(--rcp-safe-bottom))!important;
  top:auto!important;
  left:auto!important;
  margin:0!important;
  opacity:1!important;
  visibility:visible!important;
  pointer-events:auto!important;
  transform:none!important;
  translate:none!important;
  will-change:auto!important;
  transition:background .18s ease,box-shadow .18s ease,filter .18s ease!important;
  z-index:10080!important;
}
html body .floating-calendar-btn:hover,
html body .floating-yescom-btn:hover,
html body .floating-maintenance-btn:hover{
  transform:none!important;
  translate:none!important;
}
html body .floating-calendar-btn{right:var(--rcp-fab-right-1)!important;}
html body .floating-yescom-btn{right:var(--rcp-fab-right-2)!important;}
html body.admin-page .floating-maintenance-btn,
html body.admin-form-corrida-ativo .floating-maintenance-btn,
html body.admin-form-edicao-corrida-ativo .floating-maintenance-btn,
html body .floating-maintenance-btn#maintenanceFloatingBtn,
html body .floating-maintenance-btn#maintenanceFloatingBtnFallback{
  right:var(--rcp-fab-right-3)!important;
  background:linear-gradient(135deg,#64748b,#334155)!important;
}
html body.admin-page .floating-maintenance-btn.is-active,
html body.admin-form-corrida-ativo .floating-maintenance-btn.is-active,
html body.admin-form-edicao-corrida-ativo .floating-maintenance-btn.is-active,
html body .floating-maintenance-btn#maintenanceFloatingBtn.is-active,
html body .floating-maintenance-btn#maintenanceFloatingBtnFallback.is-active{
  background:linear-gradient(135deg,#f97316,#ea580c)!important;
  box-shadow:0 16px 34px rgba(249,115,22,.34)!important;
}
html body .salvar-corrida-flutuante{
  bottom:calc(var(--rcp-fab-bottom) + var(--rcp-safe-bottom) + var(--rcp-fab-size) + 18px)!important;
  z-index:10120!important;
}
body.floating-modal-open .floating-calendar-btn,
body.floating-modal-open .floating-yescom-btn,
body.floating-modal-open .floating-maintenance-btn{
  transform:none!important;
}

/* PWA: card antigo restrito por JS a Corridas/Admin. Mantém estilo estável. */
.pwa-install-card,.pwa-install-banner{box-sizing:border-box;}

/* Botão de relatórios padronizado com o botão Staffs. */
.botao-relatorios-final-inscritos,
.botao-relatorios-final-inscritos.botao-dashboard-checkin{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  gap:8px!important;
  text-align:center!important;
  line-height:1!important;
}
.botao-relatorios-final-inscritos > *,
.botao-relatorios-final-inscritos.botao-dashboard-checkin > *{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  margin:0!important;
  line-height:1!important;
}

@media(max-width:370px){
  :root{
    --rcp-fab-size:52px;
    --rcp-fab-right-1:10px;
    --rcp-fab-right-2:66px;
    --rcp-fab-right-3:122px;
  }
}


/* Base visual modular para botões e modais reutilizáveis */
.pwa-install-card,.pwa-install-banner{box-sizing:border-box;}
.modal-overlay,.maintenance-modal-overlay{position:fixed;inset:0;z-index:20000;display:flex;align-items:center;justify-content:center;padding:18px;background:rgba(15,23,42,.45);}
.modal-content,.maintenance-modal,.maintenance-panel{width:min(100%,420px);background:#fff;border-radius:22px;box-shadow:0 24px 70px rgba(15,23,42,.28);padding:18px;}
.botao-relatorios-final-inscritos,.botao-relatorios-final-inscritos.botao-dashboard-checkin{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:8px!important;text-align:center!important;line-height:1!important;}
.botao-relatorios-final-inscritos > *,.botao-relatorios-final-inscritos.botao-dashboard-checkin > *{display:inline-flex!important;align-items:center!important;justify-content:center!important;margin:0!important;line-height:1!important;}


/* v4.8 - FABs completos em modo modular */
html body .floating-icon-svg,
html body .floating-icon-svg svg{
  width:28px!important;
  height:28px!important;
  display:block!important;
  flex:0 0 auto!important;
}
html body .floating-icon-svg svg,
html body .floating-icon-svg svg *{
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2.05!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
  vector-effect:non-scaling-stroke!important;
}
html body .floating-calendar-btn{
  color:#fff!important;
  background:linear-gradient(135deg,#7c3aed,#6d28d9)!important;
  box-shadow:0 16px 34px rgba(109,40,217,.28)!important;
}
html body .floating-yescom-btn{
  color:#fff!important;
  background:linear-gradient(135deg,#0f766e,#14b8a6)!important;
  box-shadow:0 16px 34px rgba(15,118,110,.28)!important;
}
html body .floating-maintenance-btn{
  color:#fff!important;
}
html body .floating-calendar-modal.hidden,
html body .floating-yescom-modal.hidden{display:none!important;}
html body .floating-calendar-modal,
html body .floating-yescom-modal{
  position:fixed!important;
  inset:0!important;
  z-index:20000!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:18px!important;
}
html body .floating-calendar-backdrop,
html body .floating-yescom-backdrop{
  position:absolute!important;
  inset:0!important;
  background:rgba(15,23,42,.52)!important;
  -webkit-backdrop-filter:blur(5px)!important;
  backdrop-filter:blur(5px)!important;
}
html body .floating-calendar-box,
html body .floating-yescom-box{
  position:relative!important;
  z-index:1!important;
  width:min(520px,100%)!important;
  max-height:calc(100dvh - 36px)!important;
  overflow:auto!important;
  background:#fff!important;
  color:#0f172a!important;
  border:1px solid rgba(226,232,240,.9)!important;
  border-radius:24px!important;
  box-shadow:0 28px 80px rgba(15,23,42,.35)!important;
}
html body .floating-calendar-box{padding:20px!important;}
html body .floating-calendar-header,
html body .floating-yescom-header{
  display:flex!important;
  align-items:flex-start!important;
  justify-content:space-between!important;
  gap:14px!important;
  margin:0 0 16px!important;
}
html body .floating-calendar-label{
  margin:0 0 4px!important;
  color:#64748b!important;
  font-size:12px!important;
  font-weight:900!important;
  text-transform:uppercase!important;
  letter-spacing:.06em!important;
}
html body .floating-calendar-header h2,
html body .floating-yescom-header h2{
  margin:0!important;
  color:#0f172a!important;
  font-size:22px!important;
  line-height:1.1!important;
  font-weight:950!important;
}
html body .floating-calendar-close{
  width:38px!important;
  height:38px!important;
  border:0!important;
  border-radius:999px!important;
  background:#f1f5f9!important;
  color:#334155!important;
  font-size:25px!important;
  line-height:1!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  padding:0!important;
}
html body .floating-calendar-controls{display:grid!important;gap:8px!important;margin:0 0 12px!important;}
html body .floating-calendar-nav-row,
html body .floating-calendar-selects{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;}
html body .floating-calendar-selects{grid-template-columns:minmax(0,1fr) 110px!important;margin-bottom:10px!important;}
html body .floating-calendar-controls button,
html body .floating-calendar-selects select,
html body .floating-calendar-selects input{
  min-height:42px!important;
  border:1px solid #e2e8f0!important;
  border-radius:13px!important;
  background:#f8fafc!important;
  color:#0f172a!important;
  font-weight:850!important;
  font-size:13px!important;
  padding:9px 10px!important;
}
html body .floating-calendar-today{background:#dbeafe!important;border-color:#bfdbfe!important;color:#1d4ed8!important;}
html body .floating-calendar-grid{display:grid!important;grid-template-columns:repeat(7,minmax(0,1fr))!important;gap:6px!important;}
html body .floating-calendar-weekdays{margin-top:14px!important;margin-bottom:6px!important;}
html body .floating-calendar-weekday{padding:8px 3px!important;color:#64748b!important;font-size:11px!important;font-weight:950!important;text-align:center!important;text-transform:uppercase!important;}
html body .floating-calendar-day{
  min-height:42px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border:1px solid #e2e8f0!important;
  border-radius:13px!important;
  background:#fff!important;
  color:#0f172a!important;
  font-size:13px!important;
  font-weight:900!important;
  padding:0!important;
}
html body .floating-calendar-day.muted{background:#f8fafc!important;color:#cbd5e1!important;}
html body .floating-calendar-day.today{background:#2563eb!important;border-color:#2563eb!important;color:#fff!important;box-shadow:0 8px 18px rgba(37,99,235,.28)!important;}
html body .floating-yescom-box{
  width:min(1040px,calc(100vw - 28px))!important;
  height:min(760px,calc(100dvh - 52px))!important;
  display:flex!important;
  flex-direction:column!important;
  overflow:hidden!important;
  padding:0!important;
}
html body .floating-yescom-header{padding:16px 18px!important;margin:0!important;border-bottom:1px solid #e5e7eb!important;align-items:center!important;}
html body .floating-yescom-help{margin:0!important;padding:10px 16px 4px!important;font-size:12px!important;line-height:1.35!important;color:#64748b!important;font-weight:700!important;}
html body .floating-yescom-frame{width:100%!important;flex:1 1 auto!important;border:0!important;background:#fff!important;}
html body .floating-yescom-link{margin:0 16px 14px!important;display:inline-flex!important;align-self:flex-start!important;padding:10px 14px!important;border-radius:999px!important;background:#eef2ff!important;color:#3730a3!important;font-weight:900!important;text-decoration:none!important;}
@media(max-width:700px){
  html body .floating-calendar-modal,
  html body .floating-yescom-modal{align-items:flex-end!important;padding:10px!important;}
  html body .floating-calendar-box{width:100%!important;max-height:calc(100dvh - 20px)!important;border-radius:22px!important;padding:16px!important;}
  html body .floating-yescom-box{width:100%!important;height:calc(100dvh - 26px)!important;border-radius:22px!important;}
}

/* v4.8 - refinamento FABs e WhatsApp no modo modular */
html body .floating-calendar-btn,
html body .floating-yescom-btn,
html body .floating-maintenance-btn,
html body .floating-top-btn{
  border:0!important;
  outline:0!important;
  box-shadow:0 16px 34px rgba(15,23,42,.22)!important;
}
html body .floating-calendar-btn:focus,
html body .floating-yescom-btn:focus,
html body .floating-maintenance-btn:focus,
html body .floating-top-btn:focus,
html body .floating-whatsapp:focus{
  outline:0!important;
  box-shadow:0 16px 34px rgba(15,23,42,.25),0 0 0 4px rgba(255,255,255,.45)!important;
}
html body .floating-icon-svg{
  border:0!important;
  outline:0!important;
  background:transparent!important;
  box-shadow:none!important;
}
html body .floating-whatsapp{
  position:fixed!important;
  right:18px!important;
  bottom:calc(18px + env(safe-area-inset-bottom,0px))!important;
  z-index:9990!important;
  width:60px!important;
  height:60px!important;
  min-width:60px!important;
  min-height:60px!important;
  padding:0!important;
  border:0!important;
  border-radius:999px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  background:linear-gradient(135deg,#22c55e,#16a34a)!important;
  color:#fff!important;
  text-decoration:none!important;
  box-shadow:0 16px 34px rgba(22,163,74,.30)!important;
  transform:none!important;
  overflow:hidden!important;
}
html body .floating-whatsapp-icon{
  width:38px!important;
  height:38px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  border-radius:999px!important;
  background:rgba(255,255,255,.16)!important;
  color:#fff!important;
  box-shadow:none!important;
  overflow:visible!important;
}
html body .floating-whatsapp-icon svg,
html body .whatsapp-logo-svg{
  width:31px!important;
  height:31px!important;
  display:block!important;
  overflow:visible!important;
}
html body .floating-whatsapp-icon svg *,
html body .whatsapp-logo-svg *{
  stroke:initial!important;
  stroke-width:initial!important;
  fill:revert-layer!important;
  vector-effect:initial!important;
}
@supports not (fill:revert-layer){
  html body .floating-whatsapp-icon svg *,
  html body .whatsapp-logo-svg *{fill:unset!important;stroke:unset!important;}
}
body.login-page .floating-whatsapp{
  right:18px!important;
  bottom:calc(18px + env(safe-area-inset-bottom,0px))!important;
}
@media(max-width:420px){
  body.login-page .floating-whatsapp{width:58px!important;height:58px!important;min-width:58px!important;min-height:58px!important;right:18px!important;}
}

/* v4.8 - Preloader de validação no CSS modular */
html[data-css-mode="modular"] body.auth-checking{
  min-height:100vh;
  overflow:hidden;
}
html[data-css-mode="modular"] body.auth-checking > *:not(.rcp-guard-preloader){
  visibility:hidden;
  pointer-events:none;
}
html[data-css-mode="modular"] .rcp-guard-preloader{
  position:fixed;
  inset:0;
  z-index:2147482500;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:linear-gradient(135deg,rgba(232,249,246,.96),rgba(240,244,255,.96));
}
html[data-css-mode="modular"] body:not(.auth-checking):not(.rcp-page-loading) .rcp-guard-preloader{
  display:none;
}
html[data-css-mode="modular"] .rcp-guard-card{
  width:min(420px,100%);
  border-radius:30px;
  padding:30px 24px;
  background:rgba(255,255,255,.94);
  border:1px solid rgba(226,232,240,.88);
  box-shadow:0 30px 70px rgba(15,23,42,.18);
  text-align:center;
  color:#0f172a;
}
html[data-css-mode="modular"] .rcp-guard-logo{
  width:min(220px,75%);
  height:auto;
  display:block;
  margin:0 auto 18px;
}
html[data-css-mode="modular"] .rcp-guard-card strong{
  display:block;
  font-size:26px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.035em;
  margin-bottom:10px;
}
html[data-css-mode="modular"] .rcp-guard-card span{
  display:block;
  color:#64748b;
  font-size:15px;
  line-height:1.35;
  font-weight:700;
}
html[data-css-mode="modular"] .rcp-guard-actions{
  display:grid;
  gap:10px;
  margin-top:20px;
}
html[data-css-mode="modular"] .rcp-guard-actions button{
  min-height:48px;
  border:0;
  border-radius:16px;
  font-weight:850;
  color:#fff;
  background:linear-gradient(135deg,#14b8a6,#2563eb,#7c3aed);
}
html[data-css-mode="modular"] .rcp-guard-actions button + button{
  color:#334155;
  background:#f1f5f9;
}

/* v4.8 - Menu hambúrguer no CSS modular */
html[data-css-mode="modular"] .card-staff.has-admin-menu,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu{
  position:relative;
  overflow:visible;
}
html[data-css-mode="modular"] .card-staff.has-admin-menu .admin-card-acoes-logado,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu .admin-card-acoes-logado,
html[data-css-mode="modular"] .card-staff.has-admin-menu .admin-actions-hidden-by-menu,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu .admin-actions-hidden-by-menu{
  display:none;
}
html[data-css-mode="modular"] .admin-menu-toggle{
  position:absolute;
  right:22px;
  top:50%;
  transform:translateY(-50%);
  width:56px;
  height:56px;
  border:1px solid rgba(203,213,225,.78);
  border-radius:20px;
  background:linear-gradient(135deg,rgba(255,255,255,.96),rgba(245,243,255,.92));
  box-shadow:0 16px 36px rgba(15,23,42,.12);
  display:grid;
  grid-template-columns:repeat(2,7px);
  grid-template-rows:repeat(2,7px);
  gap:8px;
  align-content:center;
  justify-content:center;
  padding:0;
  z-index:6;
}
html[data-css-mode="modular"] .admin-menu-toggle span{
  display:block;
  width:7px;
  height:7px;
  border-radius:50%;
  background:#7c3aed;
}
html[data-css-mode="modular"] .admin-menu-toggle.grid-toggle span{
  width:7px;
  height:7px;
  border-radius:50%;
}
html[data-css-mode="modular"] .admin-menu-panel{
  position:fixed;
  left:18px;
  right:18px;
  bottom:calc(84px + env(safe-area-inset-bottom,0px));
  z-index:2147481200;
  max-height:min(72vh,720px);
  overflow:auto;
  padding:16px;
  border-radius:26px;
  background:rgba(255,255,255,.96);
  border:1px solid rgba(226,232,240,.9);
  box-shadow:0 30px 80px rgba(15,23,42,.20);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
}
html[data-css-mode="modular"] .admin-menu-panel[hidden]{display:none;}
html[data-css-mode="modular"] .admin-menu-item{
  min-height:76px;
  border:1px solid rgba(203,213,225,.72);
  border-radius:18px;
  background:#fff;
  display:grid;
  grid-template-columns:48px minmax(0,1fr) 18px;
  align-items:center;
  gap:10px;
  padding:10px 12px;
  text-decoration:none;
  color:#0f172a;
}
html[data-css-mode="modular"] .admin-menu-ico{
  width:44px;
  height:44px;
  border-radius:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(20,184,166,.10);
  color:#0f766e;
}
html[data-css-mode="modular"] .admin-menu-ico svg{
  width:25px;
  height:25px;
  stroke:currentColor;
  fill:none;
  stroke-width:2.2;
  stroke-linecap:round;
  stroke-linejoin:round;
}
html[data-css-mode="modular"] .admin-menu-text{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}
html[data-css-mode="modular"] .admin-menu-text strong{
  font-size:16px;
  line-height:1.05;
  font-weight:900;
  color:#0f172a;
}
html[data-css-mode="modular"] .admin-menu-text small{
  font-size:12px;
  line-height:1.12;
  font-weight:700;
  color:#64748b;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
html[data-css-mode="modular"] .admin-menu-arrow{
  justify-self:end;
  color:#334155;
  font-size:25px;
  line-height:1;
}
html[data-css-mode="modular"] .admin-menu-logout .admin-menu-ico{background:rgba(239,68,68,.11);color:#dc2626;}
html[data-css-mode="modular"] .admin-menu-logout .admin-menu-text strong{color:#991b1b;}
@media(max-width:440px){
  html[data-css-mode="modular"] .admin-menu-panel{left:14px;right:14px;padding:14px;gap:8px;}
  html[data-css-mode="modular"] .admin-menu-item{min-height:70px;grid-template-columns:42px minmax(0,1fr) 14px;padding:9px;}
  html[data-css-mode="modular"] .admin-menu-ico{width:40px;height:40px;border-radius:14px;}
  html[data-css-mode="modular"] .admin-menu-text strong{font-size:14px;}
  html[data-css-mode="modular"] .admin-menu-text small{font-size:10.6px;}
}


/* v4.8 - Menu hambúrguer modular integrado ao card do usuário */
html[data-css-mode="modular"] .card-staff.has-admin-menu,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu{
  flex-wrap:wrap;
  overflow:hidden;
  transition:border-radius .22s ease, box-shadow .22s ease, padding-bottom .22s ease;
}
html[data-css-mode="modular"] .card-staff.has-admin-menu.admin-menu-open,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu.admin-menu-open{
  border-radius:30px;
  padding-bottom:16px;
}
html[data-css-mode="modular"] .admin-global-menu{
  width:100%;
  flex:0 0 100%;
  margin:0;
  padding:0;
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:10px;
  max-height:0;
  opacity:0;
  overflow:hidden;
  pointer-events:none;
  transform:translateY(-4px);
  transition:max-height .28s ease, opacity .18s ease, transform .22s ease, margin-top .22s ease;
}
html[data-css-mode="modular"] .admin-global-menu.is-open{
  max-height:980px;
  opacity:1;
  pointer-events:auto;
  transform:translateY(0);
  margin-top:16px;
}
html[data-css-mode="modular"] .admin-global-menu[hidden]{display:none;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item{
  min-height:72px;
  border:1px solid rgba(203,213,225,.72);
  border-radius:18px;
  background:rgba(255,255,255,.84);
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 14px;
  align-items:center;
  gap:9px;
  padding:9px;
  color:#0f172a;
  text-decoration:none;
  text-align:left;
  appearance:none;
  -webkit-appearance:none;
  font:inherit;
  box-shadow:0 10px 22px rgba(15,23,42,.04);
}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-ico{
  width:42px;
  height:42px;
  border-radius:15px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(20,184,166,.10);
  color:#0f766e;
}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-ico svg{width:24px;height:24px;stroke:currentColor;fill:none;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-text{min-width:0;text-align:left;justify-self:stretch;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-text strong{display:block;font-size:15px;line-height:1.05;font-weight:900;color:#0f172a;text-align:left;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-text small{display:block;margin-top:2px;font-size:11px;line-height:1.1;font-weight:750;color:#64748b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-arrow{justify-self:end;color:#334155;font-size:23px;line-height:1;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(1) .admin-menu-ico{background:rgba(20,184,166,.12);color:#0f766e;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(2) .admin-menu-ico{background:rgba(14,165,233,.12);color:#0284c7;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(3) .admin-menu-ico{background:rgba(59,130,246,.11);color:#2563eb;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(4) .admin-menu-ico{background:rgba(20,184,166,.12);color:#0f766e;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(5) .admin-menu-ico{background:rgba(14,165,233,.10);color:#0284c7;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(6) .admin-menu-ico{background:rgba(20,184,166,.10);color:#0f766e;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(7) .admin-menu-ico{background:rgba(124,58,237,.10);color:#7c3aed;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(8) .admin-menu-ico{background:rgba(14,165,233,.10);color:#0284c7;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(9) .admin-menu-ico{background:rgba(20,184,166,.10);color:#0f766e;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(10) .admin-menu-ico{background:rgba(20,184,166,.10);color:#0f766e;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(11) .admin-menu-ico{background:rgba(20,184,166,.10);color:#0f766e;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(12) .admin-menu-ico{background:rgba(124,58,237,.10);color:#7c3aed;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-item:nth-child(13) .admin-menu-ico{background:rgba(124,58,237,.10);color:#7c3aed;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-logout .admin-menu-ico{background:rgba(239,68,68,.11);color:#dc2626;}
html[data-css-mode="modular"] .admin-global-menu .admin-menu-logout .admin-menu-text strong{color:#991b1b;}
html[data-css-mode="modular"] .card-staff.admin-menu-open .admin-menu-toggle,
html[data-css-mode="modular"] .card-staff-cadastro.admin-menu-open .admin-menu-toggle{
  background:linear-gradient(135deg,#2563eb,#7c3aed);
  border-color:rgba(124,58,237,.32);
  box-shadow:0 18px 42px rgba(124,58,237,.24);
}
html[data-css-mode="modular"] .card-staff.admin-menu-open .admin-menu-toggle span,
html[data-css-mode="modular"] .card-staff-cadastro.admin-menu-open .admin-menu-toggle span{
  width:5px;
  height:5px;
  background:#fff;
}
@media(max-width:560px){
  html[data-css-mode="modular"] .admin-global-menu{gap:8px;}
  html[data-css-mode="modular"] .admin-global-menu.is-open{margin-top:14px;}
  html[data-css-mode="modular"] .admin-global-menu .admin-menu-item{min-height:68px;grid-template-columns:40px minmax(0,1fr) 12px;padding:8px;gap:8px;border-radius:16px;}
  html[data-css-mode="modular"] .admin-global-menu .admin-menu-ico{width:38px;height:38px;border-radius:14px;}
  html[data-css-mode="modular"] .admin-global-menu .admin-menu-ico svg{width:22px;height:22px;}
  html[data-css-mode="modular"] .admin-global-menu .admin-menu-text strong{font-size:14px;}
  html[data-css-mode="modular"] .admin-global-menu .admin-menu-text small{font-size:10.6px;}
}

/* v4.8 - Tela de validação modular com ação única de saída */
html[data-css-mode="modular"] .rcp-guard-actions{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
  width:100%;
  margin-top:12px;
}
html[data-css-mode="modular"] .rcp-guard-actions button{
  border:0;
  border-radius:16px;
  padding:12px 14px;
  font-weight:900;
  font-size:13px;
  color:#334155;
  background:#f1f5f9;
}


/* v4.8 - estabilização do menu integrado ao card logado */
html[data-css-mode="modular"] .card-staff.has-admin-menu:not(.admin-menu-open),
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu:not(.admin-menu-open){
  padding-top:18px;
  padding-bottom:18px;
}
html[data-css-mode="modular"] .card-staff.has-admin-menu .admin-menu-toggle,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu .admin-menu-toggle{
  top:66px;
  transform:translateY(-50%);
}
html[data-css-mode="modular"] .card-staff.has-admin-menu.admin-menu-open .admin-menu-toggle,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu.admin-menu-open .admin-menu-toggle{
  top:66px;
  transform:translateY(-50%);
}
@media(max-width:560px){
  html[data-css-mode="modular"] .card-staff.has-admin-menu .admin-menu-toggle,
  html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu .admin-menu-toggle,
  html[data-css-mode="modular"] .card-staff.has-admin-menu.admin-menu-open .admin-menu-toggle,
  html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu.admin-menu-open .admin-menu-toggle{
    top:62px;
  }
}

/* v16.5 - fotos seguras de staff no CSS modular
   Mantém placeholder enquanto a imagem carrega e evita ícone quebrado quando o storage falha. */
img.staff-photo-safe{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:0;
  transition:opacity .16s ease;
}

img.staff-photo-safe.staff-photo-loaded{
  opacity:1;
}

.foto-staff-wrapper:not(.staff-photo-ready),
.admin-staff-card-foto:not(.staff-photo-ready),
.admin-ultimo-inscrito-foto:not(.staff-photo-ready),
.card-conferencia-foto:not(.staff-photo-ready),
.card-conferencia-compacto-foto:not(.staff-photo-ready),
.ultimo-cadastro-foto:not(.staff-photo-ready),
.dashboard-ultimo-avatar.has-photo:not(.staff-photo-ready){
  background:linear-gradient(135deg,#e2e8f0,#f8fafc);
}

.foto-staff-wrapper.staff-photo-ready::before,
.admin-staff-card-foto.staff-photo-ready::before,
.admin-ultimo-inscrito-foto.staff-photo-ready::before,
.card-conferencia-foto.staff-photo-ready::before,
.card-conferencia-compacto-foto.staff-photo-ready::before,
.ultimo-cadastro-foto.staff-photo-ready::before,
.dashboard-ultimo-avatar.has-photo.staff-photo-ready::before{
  display:none;
}

/* v16.5 - Card modular de instalação PWA recuperado do legado seguro */
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card{
  position:fixed;
  left:12px;
  top:auto;
  bottom:calc(96px + env(safe-area-inset-bottom,0px));
  width:178px;
  max-width:calc(100vw - 24px);
  transform:translate3d(-12px,10px,0);
  opacity:0;
  z-index:2147482500;
  pointer-events:none;
  transition:opacity .18s ease, transform .18s ease;
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card.is-visible{
  opacity:1;
  transform:translate3d(0,0,0);
  pointer-events:auto;
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-card-inner{
  position:relative;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:10px;
  padding:12px;
  border-radius:0 22px 22px 0;
  background:#fff;
  border:1px solid rgba(226,232,240,.9);
  box-shadow:0 18px 38px rgba(15,23,42,.22);
  box-sizing:border-box;
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-media{
  display:block;
  width:100%;
  height:auto;
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-icon{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:1/1;
  object-fit:cover;
  border-radius:16px;
  background:#0f172a;
  box-shadow:none;
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-action{
  width:100%;
  min-height:48px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  border-radius:14px;
  background:#10b981;
  color:#fff;
  font-size:20px;
  font-weight:950;
  line-height:1;
  box-shadow:none;
  padding:0 12px;
  cursor:pointer;
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-action:active{
  transform:translateY(1px);
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-close{
  display:flex;
  position:absolute;
  top:8px;
  right:8px;
  width:34px;
  height:34px;
  border:0;
  border-radius:999px;
  align-items:center;
  justify-content:center;
  background:rgba(241,245,249,.96);
  color:#64748b;
  font-size:24px;
  font-weight:950;
  line-height:1;
  z-index:2;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(15,23,42,.16);
}
html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-text{
  display:none;
}
@media(max-width:420px){
  html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card{
    left:10px;
    bottom:calc(88px + env(safe-area-inset-bottom,0px));
    width:156px;
    max-width:calc(100vw - 20px);
  }
  html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-card-inner{
    padding:10px;
    gap:9px;
    border-radius:0 20px 20px 0;
  }
  html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-action{
    min-height:44px;
    font-size:18px;
    border-radius:13px;
  }
  html[data-css-mode="modular"] body .pwa-install-card.pwa-install-legacy-card .pwa-install-close{
    width:32px;
    height:32px;
    font-size:22px;
  }
}


/* v16.5 - neutralização de posicionamento legado do card logado */
html[data-css-mode="modular"] .card-staff.has-admin-menu .foto-staff-wrapper,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu .foto-staff-wrapper,
html[data-css-mode="modular"] .card-staff.has-admin-menu .dados-staff,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu .dados-staff{transform:none!important;transition:none!important;}
html[data-css-mode="modular"] .card-staff.has-admin-menu .admin-menu-toggle,
html[data-css-mode="modular"] .card-staff-cadastro.has-admin-menu .admin-menu-toggle{position:static!important;inset:auto!important;transform:none!important;translate:none!important;}

/* v14.8 - tela de validação mais estável e mensagens compactas */
html[data-css-mode="modular"].rcp-post-login-validating body::after,
html[data-css-mode="modular"].rcp-route-pending body::after{
  content:"Validando acesso"!important;
  min-width:min(340px,calc(100vw - 48px));
  text-align:center;
}
html[data-css-mode="modular"] .rcp-guard-card{
  transform:translateZ(0);
}
html[data-css-mode="modular"] .rcp-guard-card span{
  min-height:1.35em;
}

/* v14.8 - proteção global contra ícone de imagem privada quebrada.
   A imagem privada só aparece depois que o Storage Helper resolve, pré-carrega e marca como pronta. */
html[data-css-mode="modular"] img[data-storage-bucket="fotos-staffs"]:not(.rcp-img-ready):not(.staff-photo-loaded),
html[data-css-mode="modular"] img[data-storage-bucket="corrida-banners"]:not(.rcp-img-ready){
  opacity:0!important;
  visibility:hidden!important;
}
html[data-css-mode="modular"] img[data-storage-bucket="fotos-staffs"].rcp-img-ready,
html[data-css-mode="modular"] img[data-storage-bucket="fotos-staffs"].staff-photo-loaded,
html[data-css-mode="modular"] img[data-storage-bucket="corrida-banners"].rcp-img-ready,
html[data-css-mode="modular"] img[data-storage-bucket="corrida-banners"][src^="blob:"],
html[data-css-mode="modular"] img[data-storage-bucket="corrida-banners"][src^="data:"]{
  opacity:1!important;
  visibility:visible!important;
}


/* v14.8 - FAB de manutenção nasce na mesma posição do grupo Admin */
html[data-css-mode="modular"] body.admin-page .floating-maintenance-btn,
html[data-css-mode="modular"] body.admin-page #maintenanceFloatingBtn,
html[data-css-mode="modular"] body.admin-page #maintenanceFloatingBtnFallback{
  bottom:calc(var(--rcp-fab-bottom-admin, var(--rcp-fab-bottom,14px)) + env(safe-area-inset-bottom,0px))!important;
  transform:none!important;
  translate:none!important;
  transition:none!important;
}

/* v18.6 - Preloader de validação: brilho suave só sobre o logo */
html[data-css-mode="modular"] .rcp-guard-logo-wrap{
  position:relative;
  display:block;
  width:min(220px,75%);
  margin:0 auto 18px;
  line-height:0;
}
html[data-css-mode="modular"] .rcp-guard-logo-wrap .rcp-guard-logo{
  width:100%;
  max-width:none;
  margin:0;
}
html[data-css-mode="modular"] .rcp-guard-logo-wrap::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(105deg,transparent 0%,transparent 38%,rgba(255,255,255,.96) 48%,transparent 58%,transparent 100%);
  background-size:240% 100%;
  background-position:-190% 0;
  -webkit-mask-image:url('../images/rcp-run-staff-logo.png');
  mask-image:url('../images/rcp-run-staff-logo.png');
  -webkit-mask-repeat:no-repeat;
  mask-repeat:no-repeat;
  -webkit-mask-position:center;
  mask-position:center;
  -webkit-mask-size:contain;
  mask-size:contain;
  animation:rcpGuardLogoShimmerV175 2.85s cubic-bezier(.4,0,.2,1) infinite;
}
@keyframes rcpGuardLogoShimmerV175{
  0%{background-position:-190% 0;opacity:.72}
  52%{background-position:190% 0;opacity:1}
  100%{background-position:190% 0;opacity:.72}
}
