.assist-toolbar{display:inline-flex;gap:8px;align-items:center;flex-wrap:wrap}
.assist-icon-btn{width:40px;height:40px;min-width:40px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;border:1px solid rgba(255,255,255,.26);background:rgba(255,255,255,.04);color:#fff;cursor:pointer;padding:0}
.assist-icon-btn:hover{background:rgba(197,31,42,.12);border-color:rgba(197,31,42,.42)}
.assist-icon-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.assist-icon-btn .assist-academia-icon{width:21px;height:21px;display:block;object-fit:contain;filter:invert(1)}
.table-export-toolbar{display:none;gap:8px;align-items:center;flex-wrap:wrap}
.table-export-toolbar.visible{display:inline-flex}
.table-export-btn{width:40px;height:40px;min-width:40px;min-height:40px;display:inline-flex;align-items:center;justify-content:center;border-radius:10px;border:1px solid rgba(255,255,255,.26);background:rgba(255,255,255,.04);cursor:pointer;padding:0}
.table-export-btn:hover{background:rgba(255,255,255,.09)}
.table-export-btn svg{width:24px;height:24px;display:block}
.table-export-btn.pdf:hover{border-color:rgba(229,57,53,.62);background:rgba(229,57,53,.12)}
.table-export-btn.excel:hover{border-color:rgba(33,115,70,.72);background:rgba(33,115,70,.14)}
.assist-modal-backdrop{display:none;position:fixed;inset:0;z-index:900;background:rgba(0,0,0,.72);align-items:flex-start;justify-content:center;padding:22px}
.assist-modal-backdrop.open{display:flex}
.assist-modal{width:min(760px,calc(100vw - 44px));max-height:calc(100vh - 44px);overflow:auto;background:#0f1722;border:1px solid rgba(255,255,255,.12);border-radius:18px;box-shadow:0 26px 90px rgba(0,0,0,.48);padding:18px}
.assist-modal-header{display:flex;align-items:flex-start;justify-content:space-between;gap:16px;border-bottom:1px solid rgba(255,255,255,.09);padding-bottom:12px;margin-bottom:14px}
.assist-modal-eyebrow{color:#99a6b5;font-size:11px;letter-spacing:.08em;text-transform:uppercase;font-weight:800}
.assist-modal-title{margin:3px 0 0;font-size:22px;line-height:1.2;color:#fff}
.assist-modal-close{width:38px;height:38px;border-radius:12px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.04);color:#fff;cursor:pointer;font-size:22px;line-height:1}
.assist-modal-body{color:#e8eef6;font-size:14px;line-height:1.58}
.assist-modal-body h4{margin:16px 0 7px;font-size:14px;color:#fff}
.assist-modal-body p{margin:0 0 10px}
.assist-modal-body ul{margin:0 0 12px 18px;padding:0}
.assist-modal-body li{margin:5px 0}
.assist-modal-body a{color:#fff;text-decoration:underline;text-decoration-color:rgba(255,255,255,.42);text-underline-offset:3px}
.assist-close{position:absolute;right:14px;top:12px;width:34px;height:34px;border-radius:10px;border:1px solid rgba(255,255,255,.18);background:rgba(255,255,255,.04);color:#fff;cursor:pointer;font-size:22px;line-height:1}
.assist-modal{position:relative}
.assist-kicker{color:#99a6b5;font-size:11px;letter-spacing:.1em;text-transform:uppercase;font-weight:800;margin-bottom:6px}
.assist-modal h2{margin:0 34px 10px 0;font-size:22px;line-height:1.2;color:#fff}
.assist-modal p{color:#e8eef6;line-height:1.55}
.assist-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:16px}
.assist-primary,.assist-secondary{border-radius:8px;border:1px solid rgba(255,255,255,.16);padding:10px 14px;font-weight:800;cursor:pointer;text-decoration:none}
.assist-primary{background:#d00000;color:#fff}
.assist-secondary{background:#151515;color:#fff}
.assist-pill-row{display:flex;gap:8px;flex-wrap:wrap;margin:10px 0 2px}
.assist-pill{border:1px solid rgba(255,255,255,.14);background:rgba(255,255,255,.045);border-radius:999px;padding:5px 9px;color:#dbe6f2;font-size:12px;font-weight:700}
.spedaudit-debug-number{position:fixed;right:10px;bottom:6px;z-index:300;color:#aeb6c2;font-size:10px;line-height:1;opacity:.68;pointer-events:none}
@media print{body.table-export-print .sidebar,body.table-export-print .topbar,body.table-export-print .assist-modal-backdrop{display:none!important}body.table-export-print .app{display:block!important}body.table-export-print .main{padding:0!important}body.table-export-print table{color:#111!important;background:#fff!important}body.table-export-print th,body.table-export-print td{color:#111!important;background:#fff!important;border-color:#888!important}}
@media(max-width:720px){.assist-toolbar,.table-export-toolbar{width:100%;justify-content:flex-start}.assist-modal-backdrop{padding:14px}.assist-modal{width:calc(100vw - 28px);max-height:calc(100vh - 28px)}}

/* v411 - contrato visual único para landings com menu lateral */
body[data-assist-page]{
  overflow:hidden;
}

body[data-assist-page] .app{
  display:block!important;
  width:100%;
  height:100vh!important;
  min-height:100vh!important;
  overflow:hidden!important;
  background:#0f141b!important;
}

body[data-assist-page] .sidebar{
  position:fixed!important;
  left:0;
  top:0;
  bottom:0;
  z-index:60;
  width:260px;
  height:100vh!important;
  min-height:100vh!important;
  overflow:auto!important;
  padding:20px 16px!important;
  display:flex!important;
  flex-direction:column!important;
  gap:16px!important;
  background:#10151d!important;
  border-right:1px solid rgba(255,255,255,.10)!important;
  border-bottom:0!important;
}

body[data-assist-page] .brand{
  display:flex!important;
  align-items:center!important;
  gap:12px!important;
  margin:0!important;
}

body[data-assist-page] .brand-mark{
  width:42px!important;
  height:42px!important;
  border-radius:10px!important;
  display:grid!important;
  place-items:center!important;
  background:rgba(255,255,255,.03)!important;
  border:1px solid rgba(255,255,255,.10)!important;
}

body[data-assist-page] .brand-mark img{
  width:34px!important;
  height:34px!important;
  object-fit:contain!important;
  display:block!important;
}

body[data-assist-page] .brand h1{
  margin:0!important;
  font-size:14px!important;
  line-height:1.2!important;
}

body[data-assist-page] .brand p{
  margin:0!important;
  color:#9aa3b2!important;
  font-size:12px!important;
}

body[data-assist-page] .sidebar .card,
body[data-assist-page] .sidebar .side-card{
  margin:0!important;
  padding:14px!important;
  border-radius:8px!important;
  background:#151b24!important;
  border:1px solid rgba(255,255,255,.10)!important;
}

body[data-assist-page] .sidebar .card h4,
body[data-assist-page] .sidebar .side-card h4{
  margin:0 0 6px!important;
  font-size:14px!important;
}

body[data-assist-page] .company-name,
body[data-assist-page] #empresaNomeDash{
  font-size:13px;
  font-weight:800;
  line-height:1.25;
}

body[data-assist-page] .sidebar nav[aria-label],
body[data-assist-page] .sidebar .nav-group{
  display:flex!important;
  flex-direction:column!important;
  gap:6px!important;
  margin:0!important;
}

body[data-assist-page] .nav-title{
  margin:8px 10px!important;
  padding:0!important;
  color:#9aa3b2!important;
  font-size:11px!important;
  font-weight:800!important;
  text-transform:uppercase!important;
  letter-spacing:0!important;
}

body[data-assist-page] .sidebar a.nav-item{
  min-height:0!important;
  display:flex!important;
  align-items:center!important;
  gap:10px!important;
  padding:10px 12px!important;
  margin:0!important;
  border-radius:8px!important;
  color:#dce3ec!important;
  text-decoration:none!important;
  font-size:14px!important;
  font-weight:500!important;
  border:1px solid transparent!important;
  cursor:pointer!important;
  pointer-events:auto!important;
  position:relative!important;
  z-index:2!important;
  user-select:none;
}

/* Mais específica que a regra acima, para que o gating de visibilidade por role/plano
   (JS liga/desliga a classe .visible em elementos .admin-only) não seja anulado pelo
   display:flex!important genérico de .nav-item. */
body[data-assist-page] .sidebar a.nav-item.admin-only{display:none!important}
body[data-assist-page] .sidebar a.nav-item.admin-only.visible{display:flex!important}

body[data-assist-page] .sidebar a.nav-item.active,
body[data-assist-page] .sidebar a.nav-item:hover{
  background:rgba(197,31,42,.16)!important;
  border-color:rgba(197,31,42,.35)!important;
  color:#fff!important;
}

body[data-assist-page] .sidebar .nav-icon{
  width:20px!important;
  min-width:20px!important;
  height:20px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  color:#dbeafe!important;
}

body[data-assist-page] .sidebar .nav-icon svg{
  width:18px!important;
  height:18px!important;
  display:block!important;
  fill:none!important;
  stroke:currentColor!important;
  stroke-width:2!important;
  stroke-linecap:round!important;
  stroke-linejoin:round!important;
}

body[data-assist-page] .sidebar-version{
  margin-top:auto!important;
  color:#9aa3b2!important;
  font-size:12px!important;
  padding:0!important;
}

body[data-assist-page] .main{
  margin-left:260px!important;
  width:calc(100% - 260px)!important;
  height:100vh!important;
  min-height:0!important;
  overflow:auto!important;
  padding:22px!important;
  background:#0f141b!important;
}

body[data-assist-page] .topbar{
  position:sticky!important;
  top:0!important;
  z-index:120!important;
  margin:-22px -22px 16px -22px!important;
  padding:22px!important;
  background:#0f141b!important;
  backdrop-filter:blur(8px)!important;
  border-bottom:1px solid rgba(255,255,255,.10)!important;
  box-shadow:0 10px 22px rgba(0,0,0,.34)!important;
  overflow:hidden!important;
  isolation:isolate!important;
}

body[data-assist-page] .topbar > *{
  position:relative!important;
  z-index:2!important;
}

body[data-assist-page] .topbar::before{
  content:"";
  position:absolute;
  left:0;
  right:0;
  top:-140px;
  bottom:0;
  background:#0f141b;
  z-index:0;
  pointer-events:none;
}

body[data-assist-page] .topbar::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-18px;
  height:20px;
  background:#0f141b;
  z-index:0;
  pointer-events:none;
}

/* v420 - botão de logout único: sempre transparente, em todas as telas */
body[data-assist-page] .btn-logout{
  background:transparent!important;
  border:1px solid rgba(255,255,255,.22)!important;
  color:#fff!important;
  box-shadow:none!important;
  font-weight:700!important;
}
body[data-assist-page] .btn-logout:hover{
  background:rgba(255,255,255,.08)!important;
  border-color:rgba(255,255,255,.34)!important;
}

/* v425 - badge de plano/validade da assinatura, injetado pelo assistencia.js em toda tela */
body[data-assist-page] .plan-badge{
  display:inline-flex!important;
  align-items:center!important;
  background:rgba(34,197,94,.10)!important;
  border:1px solid rgba(34,197,94,.35)!important;
  color:#bbf7d0!important;
  border-radius:999px!important;
  padding:10px 12px!important;
  font-size:12px!important;
  font-weight:700!important;
  white-space:nowrap!important;
}

/* v426 - cadeado visual em nav-item/botão bloqueado por plano (data-requires-plan), assistencia.js */
body[data-assist-page] .nav-locked{
  opacity:.55!important;
  cursor:not-allowed!important;
}
body[data-assist-page] .nav-locked::after{
  content:"🔒"!important;
  margin-left:auto!important;
  font-size:11px!important;
  opacity:.85!important;
}
body[data-assist-page] .nav-locked:hover{
  background:rgba(255,255,255,.04)!important;
  border-color:transparent!important;
}

/* v427 - botão flutuante global de tickets (suporte/erro/melhoria), injetado pelo assistencia.js */
.ticket-fab{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:850;
  width:52px;
  height:52px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.16);
  background:linear-gradient(135deg,#c51f2a,#8f111c);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 10px 26px rgba(0,0,0,.45);
}
.ticket-fab:hover{filter:brightness(1.08)}
.ticket-fab-badge{
  position:absolute;
  top:-4px;
  right:-4px;
  min-width:20px;
  height:20px;
  padding:0 5px;
  border-radius:999px;
  background:#22c55e;
  color:#04110a;
  font-size:11px;
  font-weight:800;
  align-items:center;
  justify-content:center;
  border:2px solid #050709;
}
.ticket-form{display:flex;flex-direction:column;gap:12px}
.ticket-form label{display:flex;flex-direction:column;gap:5px;font-size:12px;color:#99a6b5}
.ticket-form input[type="text"],
.ticket-form textarea,
.ticket-form select{
  border-radius:10px;
  border:1px solid rgba(255,255,255,.16);
  background:#0b121c;
  color:#eef3f8;
  padding:10px 12px;
  font-size:13px;
  font-family:inherit;
}
.ticket-form textarea{resize:vertical;min-height:90px}
.ticket-form .ticket-check{flex-direction:row;align-items:center;gap:8px;font-size:13px;color:#dbe6f2}
.ticket-form .ticket-check input{width:auto}
.ticket-form-actions{display:flex;justify-content:flex-end}
.ticket-msg{font-size:12px;min-height:16px;color:#99a6b5}
.ticket-msg.ok{color:#7ee2a2}
.ticket-msg.err{color:#ff9a9a}
@media(max-width:640px){
  .ticket-fab{right:14px;bottom:14px;width:48px;height:48px}
}

/* v429 - debug dinâmico admin (chip + ícone + popup), injetado pelo assistencia.js, só existe no DOM se sessao.isAdmin */
body[data-assist-page] .debug-chip{
  display:inline-flex!important;
  align-items:center!important;
  background:rgba(59,130,246,.12)!important;
  border:1px solid rgba(59,130,246,.4)!important;
  color:#93c5fd!important;
  border-radius:999px!important;
  padding:10px 12px!important;
  font-size:11px!important;
  font-weight:700!important;
  white-space:nowrap!important;
  max-width:240px!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace!important;
}
body[data-assist-page] .debug-chip.is-error{
  background:rgba(239,68,68,.14)!important;
  border-color:rgba(239,68,68,.45)!important;
  color:#fca5a5!important;
}
body[data-assist-page] .debug-icon-btn{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:38px!important;
  height:38px!important;
  border-radius:12px!important;
  border:1px solid rgba(255,255,255,.18)!important;
  background:rgba(255,255,255,.04)!important;
  color:#93c5fd!important;
  cursor:pointer!important;
}
body[data-assist-page] .debug-icon-btn:hover{background:rgba(255,255,255,.09)!important}

.debug-modal-info{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;background:rgba(255,255,255,.03);border:1px solid rgba(255,255,255,.09);border-radius:12px;padding:12px 14px;margin-bottom:14px;font-size:12px}
.debug-modal-info div{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.debug-modal-info b{color:#99a6b5;font-weight:700;margin-right:4px}
.debug-log-list{display:flex;flex-direction:column;gap:4px;max-height:46vh;overflow:auto;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11.5px}
.debug-log-line{display:grid;grid-template-columns:88px 62px 1fr auto;gap:8px;align-items:start;padding:6px 8px;border-radius:8px;background:rgba(255,255,255,.02);border:1px solid rgba(255,255,255,.05)}
.debug-log-line .t{color:#99a6b5}
.debug-log-line .st{font-weight:800;text-transform:uppercase;font-size:10px}
.debug-log-line.st-start .st{color:#93c5fd}
.debug-log-line.st-success .st{color:#7ee2a2}
.debug-log-line.st-error{background:rgba(239,68,68,.08);border-color:rgba(239,68,68,.25)}
.debug-log-line.st-error .st{color:#fca5a5}
.debug-log-line.st-info .st{color:#c7cdd6}
.debug-log-line .msg{color:#e8eef6;overflow-wrap:anywhere}
.debug-log-line .ms{color:#99a6b5;white-space:nowrap}
.debug-modal-actions{display:flex;justify-content:flex-end;gap:8px;margin-top:14px;flex-wrap:wrap}
@media(max-width:640px){
  .debug-modal-info{grid-template-columns:1fr}
  .debug-log-line{grid-template-columns:70px 54px 1fr}
  .debug-log-line .ms{display:none}
}

/* v413 - saneamento de tabelas: tabela integral, sem janela vertical pequena dentro de card */
body[data-assist-page] .compare-wrap,
body[data-assist-page] .table-scroll,
body[data-assist-page] .x-wrap,
body[data-assist-page] .table-wrap,
body[data-assist-page] .tableWrap,
body[data-assist-page] .proc-table-wrap{
  max-height:none!important;
  height:auto!important;
  min-height:0!important;
  overflow-y:visible!important;
  overflow-x:auto!important;
  -webkit-overflow-scrolling:touch;
}

body[data-assist-page] .mini-list,
body[data-assist-page] .content-scroll,
body[data-assist-page] #apuracaoRoot{
  max-height:none!important;
  height:auto!important;
  min-height:0!important;
  overflow:visible!important;
}

body[data-assist-page] .mini-item:has(.compare-wrap),
body[data-assist-page] .mini-item:has(.table-scroll),
body[data-assist-page] .mini-item:has(.x-wrap),
body[data-assist-page] #apuracaoRoot > .mini-item:has(.x-wrap){
  max-height:none!important;
  height:auto!important;
  min-height:0!important;
  overflow:visible!important;
  display:block!important;
  flex:0 0 auto!important;
}

body[data-assist-page] .compare-table,
body[data-assist-page] .exec-table,
body[data-assist-page] table{
  table-layout:auto!important;
  border-collapse:collapse!important;
}

body[data-assist-page] .compare-table th,
body[data-assist-page] .compare-table td,
body[data-assist-page] .exec-table th,
body[data-assist-page] .exec-table td{
  padding-left:4px!important;
  padding-right:4px!important;
  overflow-wrap:anywhere!important;
  word-break:normal!important;
  vertical-align:top!important;
}

body[data-assist-page] .compare-table th,
body[data-assist-page] .exec-table th{
  background:#050709!important;
  color:#fff!important;
  white-space:normal!important;
}

body[data-assist-page] .compare-table th:first-child,
body[data-assist-page] .compare-table td:first-child,
body[data-assist-page] .exec-table th:first-child,
body[data-assist-page] .exec-table td:first-child,
body[data-assist-page] .reg-col{
  width:44px!important;
  min-width:44px!important;
  max-width:54px!important;
  white-space:nowrap!important;
}

body[data-assist-page] .num,
body[data-assist-page] .num-cell,
body[data-assist-page] .num-dec,
body[data-assist-page] td.num,
body[data-assist-page] th.num{
  text-align:right!important;
  white-space:nowrap!important;
  font-variant-numeric:tabular-nums!important;
}

@media(max-width:900px){
  body[data-assist-page]{
    overflow:auto;
  }

  body[data-assist-page] .app{
    display:block!important;
    height:auto!important;
    min-height:100vh!important;
    overflow:visible!important;
  }

  body[data-assist-page] .sidebar{
    position:relative!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    bottom:auto!important;
    border-right:0!important;
    border-bottom:1px solid rgba(255,255,255,.10)!important;
  }

  body[data-assist-page] .main{
    margin-left:0!important;
    width:100%!important;
    height:auto!important;
    overflow:visible!important;
    padding:16px!important;
  }

  body[data-assist-page] .topbar{
    position:relative!important;
    top:auto!important;
    margin:0 0 16px 0!important;
    padding:0!important;
    background:transparent!important;
    border-bottom:0!important;
  }
}
