/* ImportTech | Padrão único de botões • 2026-11
 * Referência visual: fundo branco, borda azul-petróleo, texto/ícones marinhos.
 * Só aparência: mantém classes, IDs, listeners, permissões e regras existentes.
 * Navegação, olhinhos e botões de fechar preservam formato compacto próprio.
 */
:root{
  --it-btn-surface:#ffffff;
  --it-btn-hover:#edf8fa;
  --it-btn-ink:#0d3147;
  --it-btn-stroke:#8dc5d2;
  --it-btn-stroke-hover:#398ea4;
  --it-btn-ring:rgba(48,150,175,.20);
  --it-btn-elevation:0 2px 6px rgba(10,49,72,.045);
}
body.itw-app :is(
  button:not(.tab-btn):not(.it-header-tab):not(.itw-theme-toggle):not(.itw-mobile-menu):not(.source-eye):not(.password-toggle):not(.pdf-close):not(.report-close):not(.source-inspector-close):not(.it-header-logout):not(.it-action-close):not([aria-label="Fechar"]):not([aria-label="Alternar tema"]),
  input[type=button],input[type=submit],input[type=reset],.btn-acao,.quick-action
){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:9px;
  max-width:100%;
  min-height:44px;
  padding:9px 17px;
  border:1px solid var(--it-btn-stroke)!important;
  border-radius:11px!important;
  background:var(--it-btn-surface)!important;
  background-image:none!important;
  color:var(--it-btn-ink)!important;
  -webkit-text-fill-color:var(--it-btn-ink);
  box-shadow:var(--it-btn-elevation)!important;
  font-family:Inter,"Segoe UI",Arial,sans-serif!important;
  font-weight:730!important;
  font-size:13px;
  line-height:1.35;
  letter-spacing:0!important;
  text-decoration:none!important;
  text-align:center;
  cursor:pointer;
  white-space:normal;
  vertical-align:middle;
  transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease,transform .18s ease!important;
}
/* Prioritize the reference appearance over prior colorful .btn / .btn-acao classes. */
body.itw-app :is(.btn:not(.tab-btn),.btn-acao,.quick-action),
body.itw-app #aba-admin :is(.admin-save-btn,.admin-cancel-btn,.admin-mini-btn,.it-create-access),
body.itw-app .it-action-modal :is(.it-action-cancel,.it-action-confirm),
body.itw-app :is(.auth-primary-btn,.auth-secondary-btn,.overview-refresh,.overview-clear,.session-logout){
  background:var(--it-btn-surface)!important;
  background-image:none!important;
  border:1px solid var(--it-btn-stroke)!important;
  border-radius:11px!important;
  color:var(--it-btn-ink)!important;
  -webkit-text-fill-color:var(--it-btn-ink)!important;
  box-shadow:var(--it-btn-elevation)!important;
  font-weight:730!important;
}
body.itw-app :is(.btn:not(.tab-btn),.btn-acao,.quick-action),
body.itw-app #aba-admin :is(.admin-save-btn,.admin-cancel-btn,.admin-mini-btn,.it-create-access){
  min-height:43px!important;
  padding:9px 15px!important;
}
/* Even on dark canvas, the white action buttons remain white by design. */
body.itw-app.itw-dark :is(.btn:not(.tab-btn),.btn-acao,.quick-action),
body.itw-app.itw-dark #aba-admin :is(.admin-save-btn,.admin-cancel-btn,.admin-mini-btn,.it-create-access){
  background:#fff!important;
  color:var(--it-btn-ink)!important;
  -webkit-text-fill-color:var(--it-btn-ink)!important;
  border-color:var(--it-btn-stroke)!important;
}
/* Hover / focus / disabled are consistent across modules. */
body.itw-app :is(button:not(.tab-btn):not(.itw-theme-toggle):not(.itw-mobile-menu):not(.source-eye):not(.password-toggle):not(.pdf-close):not(.report-close):not(.it-header-logout),.btn-acao,.quick-action):hover:not(:disabled){
  background:var(--it-btn-hover)!important;
  border-color:var(--it-btn-stroke-hover)!important;
  box-shadow:0 5px 16px rgba(14,81,110,.11)!important;
  color:var(--it-btn-ink)!important;
  -webkit-text-fill-color:var(--it-btn-ink)!important;
  transform:translateY(-1px);
}
body.itw-app #aba-admin :is(.admin-save-btn,.admin-cancel-btn,.admin-mini-btn,.it-create-access):hover:not(:disabled){
  background:var(--it-btn-hover)!important;
  border-color:var(--it-btn-stroke-hover)!important;
  color:var(--it-btn-ink)!important;
  box-shadow:0 5px 16px rgba(14,81,110,.11)!important;
}
body.itw-app :is(.btn,.btn-acao,.quick-action,button):active:not(:disabled){transform:translateY(0)!important}
body.itw-app :is(.btn,.btn-acao,.quick-action,button):focus-visible{
  outline:2px solid #47a9bd!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 4px var(--it-btn-ring)!important;
}
body.itw-app :is(button,.btn,.btn-acao,.quick-action):disabled{
  opacity:.48!important;
  cursor:not-allowed!important;
  transform:none!important;
  box-shadow:none!important;
}
body.itw-app :is(button,.btn,.btn-acao,.quick-action) :is(i,.fa,.fas,.far,.fab,.icone-acao,.whatsapp-original-icon,.print-original-icon,.quick-action-icon){
  color:inherit!important;
}
body.itw-app :is(.btn-acao,.quick-action) :is(.icone-acao,.quick-action-icon,.excel-icon,.print-icon,.whatsapp-icon){
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
}
/* Keep the four action buttons exactly aligned with the screenshot. */
body.itw-app .botoes-acao .btn-acao{
  min-height:46px!important;
  min-width:120px!important;
  border-radius:11px!important;
  padding:10px 19px!important;
  gap:11px!important;
  background:#fff!important;
  color:#0d3147!important;
}
body.itw-app .espelho-quick-actions .quick-action{
  min-height:42px!important;
  background:#fff!important;
  border:1px solid var(--it-btn-stroke)!important;
  border-radius:10px!important;
  color:var(--it-btn-ink)!important;
}
body.itw-app .espelho-quick-actions .quick-action :is(span,i){color:inherit!important}
/* Small utilities keep their compact width but share the same family of colors. */
body.itw-app #aba-admin .admin-mini-btn,
body.itw-app .rateio-copy-button{
  min-height:34px!important;
  padding:6px 11px!important;
  border:1px solid var(--it-btn-stroke)!important;
  border-radius:9px!important;
  background:#fff!important;
  color:var(--it-btn-ink)!important;
  box-shadow:none!important;
}
body.itw-app #aba-admin :is(.admin-mini-btn.users,.admin-mini-btn.save){
  background:#fff!important;
  border-color:var(--it-btn-stroke)!important;
  color:var(--it-btn-ink)!important;
}
body.itw-app #aba-admin .admin-mini-btn.danger,
body.itw-app :is(.btn-remove,.btn-reset,.btn-acao-danger){
  background:#fff!important;
  border-color:#deb7be!important;
  color:#9b4352!important;
  -webkit-text-fill-color:#9b4352!important;
}
body.itw-app #aba-admin .admin-mini-btn.danger:hover:not(:disabled),
body.itw-app :is(.btn-remove,.btn-reset,.btn-acao-danger):hover:not(:disabled){
  background:#fff2f4!important;
  border-color:#c9828f!important;
  color:#943646!important;
}
/* Standalone pages run inside iframes and must receive the style directly. */
body:not(.itw-app) :is(button:not(#theme):not(#toggleTheme):not(#close):not(#invalidNfeClose):not(.nfe-modal-close),input[type=button],input[type=submit],input[type=reset],label.pill[for="fileDuimp"]){
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:43px;
  padding:9px 16px;
  max-width:100%;
  border:1px solid var(--it-btn-stroke)!important;
  border-radius:11px!important;
  background:#fff!important;
  background-image:none!important;
  color:var(--it-btn-ink)!important;
  -webkit-text-fill-color:var(--it-btn-ink)!important;
  box-shadow:var(--it-btn-elevation)!important;
  font-size:13px;
  font-weight:730!important;
  line-height:1.35;
  white-space:normal;
  text-align:center;
  cursor:pointer;
  transition:background-color .18s ease,border-color .18s ease,box-shadow .18s ease!important;
}
body:not(.itw-app) :is(button:not(#theme):not(#toggleTheme):not(#close):not(#invalidNfeClose):not(.nfe-modal-close),label.pill[for="fileDuimp"]):hover:not(:disabled){
  background:var(--it-btn-hover)!important;
  border-color:var(--it-btn-stroke-hover)!important;
  box-shadow:0 4px 13px rgba(14,81,110,.11)!important;
  color:var(--it-btn-ink)!important;
}
body:not(.itw-app) :is(button,label.pill[for="fileDuimp"]):focus-visible{
  outline:2px solid #47a9bd!important;
  outline-offset:3px!important;
}
body:not(.itw-app) button:disabled{opacity:.48!important;cursor:not-allowed!important}
body:not(.itw-app) button :is(i,svg){color:inherit}
body:not(.itw-app) :is(button.clear-entry,button#clear,button#invalidNfeReview){
  border-color:#b7cad7!important;
}
body:not(.itw-app) #invalidNfeClose{
  width:36px;height:36px;min-height:36px;padding:0;
  display:grid;place-items:center;
}
@media(max-width:640px){
  body.itw-app .botoes-acao .btn-acao{min-width:0!important;flex:1 1 135px!important}
  body.itw-app .espelho-quick-actions .quick-action{min-width:0!important;flex:1 1 100px!important}
  body.itw-app #aba-admin .admin-mini-btn{min-height:35px!important}
}
@media(prefers-reduced-motion:reduce){
  body.itw-app :is(button,.btn,.btn-acao,.quick-action),body:not(.itw-app) button{transition:none!important;transform:none!important}
}

/* ACTION BUTTON HIDDEN STATE: preserve the hidden attribute used by forms. */
body.itw-app :is(button,.btn,.btn-acao,.quick-action,input[type=button],input[type=submit],input[type=reset])[hidden],
body:not(.itw-app) :is(button,input[type=button],input[type=submit],input[type=reset],label.pill)[hidden]{
  display:none!important;
}


/* Espelho NF Entrada — reproduz exatamente o padrão visual escolhido.
   O selo Excel deve ser azul-marinho com o X branco, nunca texto escuro
   sobre azul-marinho. Mantém impressora, WhatsApp e limpar com ícones nítidos. */
body.itw-app #aba-espelho .botoes-acao{
  display:flex!important;
  flex-wrap:wrap!important;
  justify-content:center!important;
  align-items:center!important;
  column-gap:14px!important;
  row-gap:10px!important;
  padding:14px 8px!important;
  background:transparent!important;
}
body.itw-app #aba-espelho .botoes-acao .btn-acao{
  display:inline-flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:46px!important;
  height:46px!important;
  padding:10px 17px!important;
  gap:10px!important;
  border:1px solid #91c5d0!important;
  border-radius:11px!important;
  background:#fff!important;
  background-image:none!important;
  color:#07314a!important;
  -webkit-text-fill-color:#07314a!important;
  font-size:14px!important;
  font-weight:650!important;
  line-height:1.3!important;
  box-shadow:0 2px 6px rgba(2,27,45,.05)!important;
}
body.itw-app #aba-espelho .botoes-acao #export-espelho{width:122px!important}
body.itw-app #aba-espelho .botoes-acao #screen-espelho{width:120px!important}
body.itw-app #aba-espelho .botoes-acao #whatsapp-espelho{width:160px!important}
body.itw-app #aba-espelho .botoes-acao #reset-espelho{width:188px!important}
body.itw-app #aba-espelho .botoes-acao .btn-acao:hover:not(:disabled){
  background:#eff9fa!important;
  border-color:#328ba0!important;
  color:#07314a!important;
}
body.itw-app #aba-espelho .botoes-acao #export-espelho .icone-excel{
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:20px!important;
  min-width:20px!important;
  height:23px!important;
  padding:0!important;
  border:0!important;
  border-radius:4px!important;
  background:#072e44!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font:800 13px/1 Inter,"Segoe UI",Arial,sans-serif!important;
  box-shadow:none!important;
}
body.itw-app #aba-espelho .botoes-acao .btn-acao :is(.print-original-icon,.whatsapp-original-icon){
  color:#07314a!important;
  -webkit-text-fill-color:#07314a!important;
  font-size:18px!important;
}
body.itw-app #aba-espelho .botoes-acao .btn-acao :is(.print-original-icon,.whatsapp-original-icon)::before{
  color:#07314a!important;
  -webkit-text-fill-color:#07314a!important;
}
body.itw-app #aba-espelho .botoes-acao .it-clear-session-icon{
  width:18px!important;
  height:18px!important;
  flex:0 0 18px!important;
  stroke:#07314a!important;
  fill:none!important;
}
@media(max-width:660px){
  body.itw-app #aba-espelho .botoes-acao .btn-acao{
    flex:1 1 135px!important;
    width:auto!important;
    max-width:100%!important;
  }
}
