/* IBO ULTRA FIX19 — CAMPOS EDITÁVEIS + CONTRASTE FINAL
   Carregado novamente no rodapé para ganhar de estilos específicos de páginas. */
:root{
  --ibo19-bg:#02070d;
  --ibo19-surface:#06131f;
  --ibo19-surface-2:#091a29;
  --ibo19-input:#03101a;
  --ibo19-input-focus:#071a2a;
  --ibo19-line:#2a526f;
  --ibo19-line-focus:#5798c4;
  --ibo19-text:#c9d9e4;
  --ibo19-text-strong:#d7e5ee;
  --ibo19-muted:#8fa8ba;
  --ibo19-placeholder:#7691a5;
  --ibo19-accent:#67c8f3;
}

/* O conteúdo nunca pode ficar bloqueado por um estado residual do menu. */
html body #page-content-wrapper,
html body .max-content,
html body .max-container{pointer-events:auto!important}
@media(max-width:767.98px){
  html body.mobile-menu-open #page-content-wrapper{pointer-events:auto!important}
  html body #mobile-sidebar-backdrop{pointer-events:none!important}
  html body #wrapper.toggled #mobile-sidebar-backdrop{pointer-events:auto!important}
}

/* Todos os formulários do painel ficam acima de camadas decorativas. */
html body #page-content-wrapper form,
html body #page-content-wrapper fieldset,
html body #page-content-wrapper .form-group,
html body #page-content-wrapper .form-row,
html body #page-content-wrapper .input-group,
html body #page-content-wrapper .custom-file,
html body #page-content-wrapper .select2-container,
html body #page-content-wrapper .bootstrap-select{
  position:relative!important;
  z-index:4!important;
  pointer-events:auto!important;
}

/* Campo editável: sempre clicável, digitável, com cursor e texto visíveis. */
html body #page-content-wrapper input:not([type="hidden"]):not(:disabled),
html body #page-content-wrapper textarea:not(:disabled),
html body #page-content-wrapper select:not(:disabled),
html body #page-content-wrapper .form-control:not(:disabled),
html body #page-content-wrapper .form-select:not(:disabled),
html body #page-content-wrapper .custom-select:not(:disabled),
html body #page-content-wrapper [contenteditable="true"]{
  position:relative!important;
  z-index:6!important;
  pointer-events:auto!important;
  touch-action:manipulation!important;
  user-select:text!important;
  -webkit-user-select:text!important;
  opacity:1!important;
  visibility:visible!important;
  background:var(--ibo19-input)!important;
  background-color:var(--ibo19-input)!important;
  background-image:none!important;
  color:var(--ibo19-text)!important;
  -webkit-text-fill-color:var(--ibo19-text)!important;
  caret-color:var(--ibo19-accent)!important;
  border-color:var(--ibo19-line)!important;
  box-shadow:none!important;
}
html body #page-content-wrapper input:not([type="hidden"]):not(:disabled):focus,
html body #page-content-wrapper textarea:not(:disabled):focus,
html body #page-content-wrapper select:not(:disabled):focus,
html body #page-content-wrapper .form-control:not(:disabled):focus,
html body #page-content-wrapper .form-select:not(:disabled):focus,
html body #page-content-wrapper .custom-select:not(:disabled):focus,
html body #page-content-wrapper [contenteditable="true"]:focus{
  background:var(--ibo19-input-focus)!important;
  background-color:var(--ibo19-input-focus)!important;
  color:var(--ibo19-text-strong)!important;
  -webkit-text-fill-color:var(--ibo19-text-strong)!important;
  border-color:var(--ibo19-line-focus)!important;
  outline:0!important;
  box-shadow:0 0 0 3px rgba(87,152,196,.17)!important;
}
html body #page-content-wrapper input::placeholder,
html body #page-content-wrapper textarea::placeholder{
  color:var(--ibo19-placeholder)!important;
  -webkit-text-fill-color:var(--ibo19-placeholder)!important;
  opacity:1!important;
}

/* Select nativo e plugins: opção escolhida e opções da lista sempre legíveis. */
html body select,
html body select.form-control,
html body select.form-select,
html body select.custom-select{
  color-scheme:dark!important;
  color:var(--ibo19-text)!important;
  -webkit-text-fill-color:var(--ibo19-text)!important;
  cursor:pointer!important;
}
html body option,
html body optgroup,
html body select option,
html body select optgroup{
  background:#06131f!important;
  background-color:#06131f!important;
  color:#c9d9e4!important;
  -webkit-text-fill-color:#c9d9e4!important;
}
html body option:checked{background:#123a58!important;background-color:#123a58!important;color:#d7e5ee!important}
html body .select2-container .select2-selection,
html body .select2-container .select2-selection__rendered,
html body .select2-container .select2-results__option,
html body .bootstrap-select>.dropdown-toggle,
html body .bootstrap-select .filter-option,
html body .bootstrap-select .dropdown-item{
  background-color:var(--ibo19-input)!important;
  color:var(--ibo19-text)!important;
  -webkit-text-fill-color:var(--ibo19-text)!important;
  border-color:var(--ibo19-line)!important;
}
html body .select2-results__option--highlighted,
html body .bootstrap-select .dropdown-item:hover,
html body .bootstrap-select .dropdown-item:focus{
  background:#123a58!important;
  color:var(--ibo19-text-strong)!important;
}

/* Rótulos e nomes de funções/formulários: contraste alto sem branco puro. */
html body #page-content-wrapper :is(label,.form-label,.control-label,legend,.col-form-label,.custom-control-label,.input-group-text),
html body #page-content-wrapper .form-group>label,
html body #page-content-wrapper .field>label,
html body #page-content-wrapper .field-row>label{
  color:var(--ibo19-text-strong)!important;
  -webkit-text-fill-color:var(--ibo19-text-strong)!important;
  opacity:1!important;
  visibility:visible!important;
}
html body #page-content-wrapper :is(.form-text,.text-muted,small,.small){color:var(--ibo19-muted)!important;opacity:1!important}
html body #page-content-wrapper :is(h1,h2,h3,h4,h5,h6,.card-title,.modal-title,strong,b){color:var(--ibo19-text-strong)!important}

/* Botões e links de ação não podem sumir em fundo escuro. */
html body #page-content-wrapper :is(button,.btn,a.btn){-webkit-text-fill-color:currentColor;opacity:1!important;visibility:visible!important}
html body #page-content-wrapper :is(.btn-secondary,.btn-outline-secondary,.btn-light,.btn-default,.btn-white){color:#c9d9e4!important;background:#0a2234!important;border-color:#315d79!important}

/* Campos de arquivo e DataTables. */
html body input[type="file"],
html body input[type="file"]::file-selector-button,
html body ::-webkit-file-upload-button,
html body .dataTables_filter input,
html body .dataTables_length select{
  background:#071a29!important;
  color:#c9d9e4!important;
  -webkit-text-fill-color:#c9d9e4!important;
  border-color:#315d79!important;
}

/* Campos realmente bloqueados continuam reconhecíveis, mas legíveis. */
html body #page-content-wrapper input:disabled,
html body #page-content-wrapper textarea:disabled,
html body #page-content-wrapper select:disabled,
html body #page-content-wrapper input[readonly],
html body #page-content-wrapper textarea[readonly]{
  background:#07131f!important;
  color:#91a8b8!important;
  -webkit-text-fill-color:#91a8b8!important;
  opacity:1!important;
}

/* Evita que ícones decorativos por cima de inputs capturem o toque. */
html body #page-content-wrapper :is(.field-box>i,.input-group-prepend i,.input-group-append i,.rp-list-search-icon,.rp-menu-search-icon){pointer-events:none!important}

/* Login: nome do painel visível e destacado. */
html body .login-kicker{
  display:inline-flex!important;
  align-items:center!important;
  max-width:100%!important;
  margin:0 0 12px!important;
  padding:8px 13px!important;
  border:1px solid #315d79!important;
  border-radius:999px!important;
  background:#0b2639!important;
  color:#79d1f5!important;
  -webkit-text-fill-color:#79d1f5!important;
  font-size:13px!important;
  font-weight:900!important;
  letter-spacing:.10em!important;
  text-shadow:0 1px 12px rgba(103,200,243,.20)!important;
  opacity:1!important;
}
html body .login-footer,html body .login-footer strong{color:#9fb7c7!important;-webkit-text-fill-color:#9fb7c7!important;opacity:1!important}
html body .login-card :is(label,h1){color:#d7e5ee!important;-webkit-text-fill-color:#d7e5ee!important}
html body .login-card input:not(:disabled){pointer-events:auto!important;user-select:text!important;-webkit-user-select:text!important;color:#c9d9e4!important;-webkit-text-fill-color:#c9d9e4!important;caret-color:#67c8f3!important}
html body .login-card input::placeholder{color:#7691a5!important;-webkit-text-fill-color:#7691a5!important;opacity:1!important}

/* Contraste final de containers carregados por CSS específico da página. */
html body #page-content-wrapper :is(.card,.card-body,.card-header,.card-footer,.modal-content,.modal-header,.modal-body,.modal-footer,.dropdown-menu,.dropdown-item,.list-group-item,.table-responsive,.rp-section-card,.rp-user-card,.rp-plan-item,.rp-payment-row,.rev-card,.rp-notice-card,.rp-update-card,.rp-update-admin,.rp-app-manager-card,.rp-app-card){
  color:var(--ibo19-text)!important;
}
html body #page-content-wrapper :is(.modal-body,.card-body,.dropdown-item,.nav-link,.page-link,.table,td,th){color:var(--ibo19-text)!important}
html body #page-content-wrapper :is(.dropdown-item:hover,.dropdown-item:focus,.nav-link:hover,.page-link:hover){color:var(--ibo19-text-strong)!important}

/* Menu lateral: nomes das funções nunca ficam escuros/invisíveis. */
html body #sidebar-wrapper.rp-menu-sheet,
html body #sidebar-wrapper.rp-menu-sheet :is(.rp-menu-card,.rp-menu-card span,.rp-menu-group h3,.rp-menu-account,.rp-menu-account strong,.rp-menu-account small,.rp-live-search-item,.rp-live-search-item strong,.rp-live-search-item small){
  color:var(--ibo19-text)!important;
  -webkit-text-fill-color:var(--ibo19-text)!important;
}
html body #sidebar-wrapper.rp-menu-sheet .rp-menu-card:hover,
html body #sidebar-wrapper.rp-menu-sheet .rp-menu-card.active{color:var(--ibo19-text-strong)!important;-webkit-text-fill-color:var(--ibo19-text-strong)!important}

/* Componentes de revenda: valor selecionado, patente, plano e textos dos modais. */
html body.rp-page-revendas :is(select.form-control,select.form-control option,.rev-section-title,.rev-access-grid strong,.rev-modal-summary strong,.modal-title,.modal-body){
  color:var(--ibo19-text)!important;
  -webkit-text-fill-color:var(--ibo19-text)!important;
}
html body.rp-page-revendas select.form-control option{background:#06131f!important;background-color:#06131f!important}

/* Páginas auxiliares/standalone que não usam #page-content-wrapper. */
html body input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not(:disabled),
html body textarea:not(:disabled),
html body select:not(:disabled){
  pointer-events:auto!important;
  touch-action:manipulation!important;
  visibility:visible!important;
  opacity:1!important;
  color:var(--ibo19-text)!important;
  -webkit-text-fill-color:var(--ibo19-text)!important;
  caret-color:var(--ibo19-accent)!important;
}

/* Ações e avisos: texto sempre legível sobre o tema escuro. */
html body #page-content-wrapper button:not(.close),
html body #page-content-wrapper .btn,
html body #page-content-wrapper a.btn,
html body #page-content-wrapper .rp-install-panel-button{
  color:#c9d9e4!important;
  -webkit-text-fill-color:#c9d9e4!important;
}
html body #page-content-wrapper :is(.toast,.toast-body,.toast-header,.rp-copy-toast,.alert,.rp-message-modal,.rp-message-modal .modal-content){
  color:var(--ibo19-text)!important;
  -webkit-text-fill-color:var(--ibo19-text)!important;
}
