/* Carregado após os estilos específicos das páginas para manter o visual unificado. */
body.panel-modern,body.panel-modern .page-wrapper,body.panel-modern .page-content{background:transparent!important;color:var(--panel-text)!important}
body.panel-modern .page-content>style+*{position:relative}
body.panel-modern .page-content .card,body.panel-modern .page-content [class$="-card"],body.panel-modern .page-content [class*="-card "]{color:var(--panel-text)!important}
body.panel-modern .page-content .card-header,body.panel-modern .page-content [class$="-head"],body.panel-modern .page-content [class*="-head "]{color:var(--panel-text)!important}
body.panel-modern .page-content h1,body.panel-modern .page-content h2,body.panel-modern .page-content h3,body.panel-modern .page-content h4,body.panel-modern .page-content h5,body.panel-modern .page-content h6{color:var(--panel-text)!important}
body.panel-modern .page-content p,body.panel-modern .page-content .hint,body.panel-modern .page-content .help-text,body.panel-modern .page-content .engine-help,body.panel-modern .page-content .test-sub{color:var(--panel-muted)!important}
body.panel-modern .page-content .text-white:not(.btn):not(.badge),body.panel-modern .page-content .text-white-50{color:var(--panel-text)!important}

body.panel-modern .test-wrap{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px!important}
body.panel-modern .test-card{background:#fff!important;border-color:var(--panel-border)!important;box-shadow:var(--panel-shadow)!important}
body.panel-modern .test-card .test-head{padding:18px 20px!important;border-bottom:1px solid var(--panel-border-soft)!important;background:#fbfdff!important}
body.panel-modern .test-card .test-body{padding:20px!important}
body.panel-modern .test-icon{background:var(--panel-primary-soft)!important;color:var(--panel-primary)!important}
body.panel-modern .provider-pill,body.panel-modern .soft-box{background:#f8fbff!important;border-color:var(--panel-border)!important;color:var(--panel-text)!important}
body.panel-modern .provider-pill.active{background:#edf6ff!important;border-color:#77b1eb!important;box-shadow:0 0 0 3px rgba(23,105,210,.08)}
body.panel-modern .provider-pill strong{color:var(--panel-text)!important}
body.panel-modern .provider-pill span{color:var(--panel-muted)!important}

body.panel-modern .app-color-card{background:#fff!important;border-color:var(--panel-border)!important;box-shadow:var(--panel-shadow)!important}
body.panel-modern .app-color-head{background:linear-gradient(135deg,#f7fbff,#eef6ff)!important;border-bottom:1px solid var(--panel-border)!important}
body.panel-modern .app-color-head h4,body.panel-modern .app-color-head p,body.panel-modern .color-card,body.panel-modern .color-card label{color:var(--panel-text)!important}
body.panel-modern .color-card,body.panel-modern .api-note{background:#f8fbff!important;border-color:var(--panel-border)!important}

body.panel-modern .p2p-wrap{color:var(--panel-text)!important}
body.panel-modern .p2p-hero{padding:20px!important;background:linear-gradient(135deg,#ffffff,#f1f7ff)!important;border:1px solid var(--panel-border)!important;border-radius:20px!important;box-shadow:var(--panel-shadow)!important;color:var(--panel-text)!important}
body.panel-modern .p2p-hero p,body.panel-modern .p2p-last{color:var(--panel-muted)!important}
body.panel-modern .p2p-card{background:#fff!important;border-color:var(--panel-border)!important;box-shadow:var(--panel-shadow)!important}
body.panel-modern .p2p-card .card-header{background:#fbfdff!important;color:var(--panel-text)!important;border-bottom-color:var(--panel-border-soft)!important}
body.panel-modern .p2p-card .card-body{color:var(--panel-text)!important}
body.panel-modern .p2p-note{background:#eef6ff!important;border-color:#cde4fb!important;color:#215f99!important}

body.panel-modern .emu-card{background:#fff!important;border-color:var(--panel-border)!important;box-shadow:var(--panel-shadow)!important}
body.panel-modern .emu-head{background:#fbfdff!important;border-bottom:1px solid var(--panel-border-soft)!important}
body.panel-modern .emu-head h5{color:var(--panel-text)!important}

body.panel-modern .maintenance-preview,body.panel-modern .branding-note,body.panel-modern .json-box,body.panel-modern .secure-box,body.panel-modern .admin-pass-card{background:#f8fbff!important;border-color:var(--panel-border)!important;color:var(--panel-text)!important}
body.panel-modern .branding-preview{background:#f4f8fc!important;border-color:var(--panel-border)!important}
body.panel-modern .page-content .card[style*="background:#121212"],body.panel-modern .page-content .card[style*="background: #121212"]{background:#fff!important;border-color:var(--panel-border)!important}

body.panel-modern .dns-wrap,body.panel-modern .rev-wrap,body.panel-modern .maintenance-wrap,body.panel-modern .app-color-wrap,body.panel-modern .emu-wrap,body.panel-modern .p2p-wrap{padding:0!important}
body.panel-modern .dns-card,body.panel-modern .rev-card,body.panel-modern .maintenance-card{margin-bottom:16px!important}
body.panel-modern .dns-title h5,body.panel-modern .rev-title h5{margin:0!important}
body.panel-modern .pill{background:#edf6ff!important;border-color:#d1e7ff!important;color:#1b64ad!important}
body.panel-modern .badge-soft{background:#edf7ff!important;border-color:#cfe7fb!important;color:#1763a9!important}
body.panel-modern .kpi-tag{background:#f4f8fc!important;border-color:var(--panel-border)!important}

body.panel-modern .page-content center img{border-radius:18px;border:1px solid var(--panel-border);background:#fff;padding:8px;box-shadow:var(--panel-shadow);max-height:360px;object-fit:contain}
body.panel-modern .page-content>div.card:only-of-type{max-width:none}
body.panel-modern .marquee{display:none!important}
body.panel-modern .pairing-modal-backdrop{background:rgba(4,18,34,.55)!important;backdrop-filter:blur(4px)}

@media(max-width:991.98px){
  body.panel-modern .test-wrap{grid-template-columns:1fr!important}
  body.panel-modern .p2p-grid{grid-template-columns:1fr!important}
  body.panel-modern .p2p-full{grid-column:auto!important}
}
@media(max-width:767.98px){
  body.panel-modern .provider-grid{grid-template-columns:1fr!important}
  body.panel-modern .save-row{flex-direction:column!important;align-items:stretch!important}
  body.panel-modern .save-row .btn{width:100%}
  body.panel-modern .p2p-hero{padding:16px!important}
}


/* =========================================================
   Tema escuro global + correções estruturais
   ========================================================= */
:root{
  --panel-primary:#248bff;
  --panel-primary-strong:#0d6efd;
  --panel-primary-soft:rgba(36,139,255,.15);
  --panel-secondary:#38bdf8;
  --panel-bg:#070b12;
  --panel-surface:#0d1520;
  --panel-surface-soft:#111c29;
  --panel-text:#f4f8ff;
  --panel-muted:#a8bad0;
  --panel-border:#1d75dc;
  --panel-border-soft:rgba(36,139,255,.28);
  --panel-shadow:0 14px 38px rgba(0,0,0,.28);
  --panel-shadow-lg:0 28px 80px rgba(0,0,0,.45);
}

html.panel-html{
  background:#070b12!important;
  color-scheme:dark;
}
body.panel-modern{
  min-height:100vh!important;
  height:auto!important;
  display:block!important;
  align-items:initial!important;
  justify-content:initial!important;
  background:
    radial-gradient(circle at 8% 0%,rgba(36,139,255,.12),transparent 30%),
    radial-gradient(circle at 100% 18%,rgba(14,165,233,.08),transparent 25%),
    #070b12!important;
  color:var(--panel-text)!important;
}
body.panel-modern .wrapper{min-height:100vh!important;display:flex!important;flex-direction:column!important}

/* A página usa o scroll do documento; evita o scroll interno que cortava o rodapé. */
body.panel-modern .page-wrapper{
  display:block!important;
  flex:1 0 auto!important;
  height:auto!important;
  min-height:calc(100vh - var(--topbar-height) - 62px)!important;
  margin-bottom:0!important;
  overflow:visible!important;
  background:#070b12!important;
}
body.panel-modern .page-content{
  min-height:calc(100vh - var(--topbar-height) - 62px)!important;
  background:#070b12!important;
  color:var(--panel-text)!important;
}

/* Corrige o rodapé antigo que ainda herdava fixed + left/right. */
body.panel-modern .page-footer{
  position:relative!important;
  left:auto!important;right:auto!important;bottom:auto!important;top:auto!important;
  width:calc(100% - var(--sidebar-width))!important;
  max-width:none!important;
  margin:0 0 0 var(--sidebar-width)!important;
  flex:0 0 auto!important;
  min-height:62px!important;
  background:#0a111b!important;
  color:var(--panel-muted)!important;
  border-top:1px solid var(--panel-border)!important;
  box-shadow:0 -8px 24px rgba(0,0,0,.16)!important;
}
body.panel-modern .footer-premium{width:100%!important}
body.panel-modern .footer-premium a{color:#65adff!important}
body.panel-modern .footer-dot{color:#248bff!important}

body.panel-modern .topbar{
  background:rgba(9,16,26,.96)!important;
  border-bottom:1px solid var(--panel-border)!important;
  box-shadow:0 8px 28px rgba(0,0,0,.22)!important;
}
body.panel-modern .topbar-page-copy strong,
body.panel-modern .topbar-profile,
body.panel-modern .topbar-profile-copy strong{color:#fff!important}
body.panel-modern .topbar-page-copy small,
body.panel-modern .topbar-profile-copy small{color:var(--panel-muted)!important}
body.panel-modern .topbar-page-icon,
body.panel-modern .mobile-page-icon{
  color:#65adff!important;background:rgba(36,139,255,.14)!important;border-color:rgba(36,139,255,.45)!important
}
body.panel-modern .topbar-status,
body.panel-modern .topbar-date,
body.panel-modern .topbar-profile,
body.panel-modern .mobile-toggle-menu{
  background:#101a27!important;color:#eaf3ff!important;border-color:rgba(36,139,255,.38)!important
}
body.panel-modern .topbar-profile:hover{background:#142236!important;border-color:#248bff!important}
body.panel-modern .mobile-page-heading{
  background:#0d1520!important;color:#fff!important;border-color:#248bff!important;box-shadow:var(--panel-shadow)!important
}

/* Superfícies */
body.panel-modern .card,
body.panel-modern .dns-card,
body.panel-modern .rev-card,
body.panel-modern .test-card,
body.panel-modern .emu-card,
body.panel-modern .p2p-card,
body.panel-modern .app-color-card,
body.panel-modern .maintenance-card,
body.panel-modern .branding-card,
body.panel-modern .admin-pass-card,
body.panel-modern .maintenance-preview,
body.panel-modern .branding-note,
body.panel-modern .json-box,
body.panel-modern .secure-box,
body.panel-modern .soft-box,
body.panel-modern .color-card,
body.panel-modern .api-note,
body.panel-modern .provider-pill,
body.panel-modern .p2p-hero,
body.panel-modern .p2p-note,
body.panel-modern .kpi,
body.panel-modern .rev-kpi,
body.panel-modern .kpi-tag,
body.panel-modern .badge-soft,
body.panel-modern .pill{
  background:#0d1520!important;
  color:var(--panel-text)!important;
  border-color:rgba(36,139,255,.55)!important;
}
body.panel-modern .card-header,
body.panel-modern .card-footer,
body.panel-modern .test-card .test-head,
body.panel-modern .app-color-head,
body.panel-modern .p2p-card .card-header,
body.panel-modern .emu-head,
body.panel-modern .modal-header,
body.panel-modern .modal-footer{
  background:#101a27!important;
  color:#fff!important;
  border-color:rgba(36,139,255,.38)!important;
}
body.panel-modern .card-body,
body.panel-modern .modal-body{background:#0d1520!important;color:var(--panel-text)!important}
body.panel-modern .page-content h1,
body.panel-modern .page-content h2,
body.panel-modern .page-content h3,
body.panel-modern .page-content h4,
body.panel-modern .page-content h5,
body.panel-modern .page-content h6,
body.panel-modern .page-content strong,
body.panel-modern .modal-title{color:#fff!important}
body.panel-modern .page-content p,
body.panel-modern .page-content .hint,
body.panel-modern .page-content .help-text,
body.panel-modern .page-content .engine-help,
body.panel-modern .page-content .test-sub,
body.panel-modern .text-muted,
body.panel-modern .form-text,
body.panel-modern small{color:var(--panel-muted)!important}
body.panel-modern hr{border-color:rgba(36,139,255,.34)!important}

/* Formulários */
body.panel-modern .form-label,
body.panel-modern label{color:#eaf3ff!important}
body.panel-modern .form-control,
body.panel-modern .form-select,
body.panel-modern input[type="text"],
body.panel-modern input[type="password"],
body.panel-modern input[type="email"],
body.panel-modern input[type="url"],
body.panel-modern input[type="number"],
body.panel-modern input[type="date"],
body.panel-modern input[type="datetime-local"],
body.panel-modern input[type="tel"],
body.panel-modern input[type="search"],
body.panel-modern input[type="file"],
body.panel-modern textarea,
body.panel-modern select{
  background:#09111b!important;
  color:#fff!important;
  border-color:rgba(36,139,255,.68)!important;
  color-scheme:dark!important;
}
body.panel-modern .form-control:disabled,
body.panel-modern .form-select:disabled,
body.panel-modern input:disabled,
body.panel-modern textarea:disabled,
body.panel-modern select:disabled{
  background:#101823!important;color:#8093aa!important;opacity:1!important
}
body.panel-modern input::placeholder,
body.panel-modern textarea::placeholder{color:#7388a0!important}
body.panel-modern select option{background:#09111b!important;color:#fff!important}
body.panel-modern .input-group-text{
  background:#111c29!important;color:#dbeafe!important;border-color:rgba(36,139,255,.68)!important
}
body.panel-modern .form-check-input{background-color:#09111b!important;border-color:#248bff!important}
body.panel-modern .form-check-input:checked{background-color:#248bff!important}
body.panel-modern input[type="file"]::file-selector-button{
  background:#13243a!important;color:#fff!important;border:0!important;border-right:1px solid #248bff!important
}

/* Tabelas e paginação */
body.panel-modern .table{
  color:#f4f8ff!important;
  --bs-table-bg:transparent!important;
  --bs-table-color:#f4f8ff!important;
  --bs-table-striped-bg:rgba(36,139,255,.055)!important;
  --bs-table-striped-color:#f4f8ff!important;
  --bs-table-hover-bg:rgba(36,139,255,.13)!important;
  --bs-table-hover-color:#fff!important;
  border-color:rgba(36,139,255,.3)!important
}
body.panel-modern .table>thead,
body.panel-modern .dataTables_wrapper .row:first-child,
body.panel-modern .dataTables_wrapper .row:last-child{background:#101a27!important}
body.panel-modern .table>thead th{
  color:#b9d9ff!important;border-color:rgba(36,139,255,.55)!important
}
body.panel-modern .table>tbody td{
  color:#eef6ff!important;border-color:rgba(36,139,255,.2)!important;background:transparent!important
}
body.panel-modern .table-hover>tbody>tr:hover>*{background:rgba(36,139,255,.13)!important;color:#fff!important}
body.panel-modern .dataTables_wrapper,
body.panel-modern .dataTables_info,
body.panel-modern .dataTables_length,
body.panel-modern .dataTables_filter{color:var(--panel-muted)!important}
body.panel-modern .page-link{
  background:#0d1724!important;color:#9fcbff!important;border-color:rgba(36,139,255,.55)!important
}
body.panel-modern .page-link:hover{background:#15263b!important;color:#fff!important}
body.panel-modern .page-item.active .page-link{background:#1769d2!important;color:#fff!important}

/* Modais, listas, menus e componentes Bootstrap */
body.panel-modern .modal-content,
body.panel-modern .dropdown-menu,
body.panel-modern .list-group-item,
body.panel-modern .accordion-item,
body.panel-modern .accordion-button,
body.panel-modern .offcanvas,
body.panel-modern .popover{
  background:#0d1520!important;color:#fff!important;border-color:rgba(36,139,255,.55)!important
}
body.panel-modern .dropdown-item{color:#eaf3ff!important}
body.panel-modern .dropdown-item:hover,
body.panel-modern .dropdown-item:focus{background:rgba(36,139,255,.16)!important;color:#fff!important}
body.panel-modern .accordion-button:not(.collapsed){background:#13243a!important;color:#fff!important}
body.panel-modern .accordion-button::after{filter:invert(1) brightness(2)}
body.panel-modern .nav-tabs{border-color:#248bff!important}
body.panel-modern .nav-tabs .nav-link{color:#a8cfff!important;border-color:transparent!important}
body.panel-modern .nav-tabs .nav-link.active{
  background:#0d1520!important;color:#fff!important;border-color:#248bff #248bff #0d1520!important
}
body.panel-modern .btn-close{filter:invert(1) grayscale(1) brightness(2);opacity:.9!important}
body.panel-modern .pairing-modal-backdrop{background:rgba(0,0,0,.72)!important}

/* Botões claros e outlines passam a combinar com o tema. */
body.panel-modern .btn-light,
body.panel-modern .btn-secondary,
body.panel-modern .btn-outline-primary,
body.panel-modern .btn-outline-secondary,
body.panel-modern .btn-outline-danger,
body.panel-modern .btn-outline-success{
  background:#111c29!important;color:#eef6ff!important;border-color:rgba(36,139,255,.62)!important
}
body.panel-modern .btn-light:hover,
body.panel-modern .btn-secondary:hover,
body.panel-modern .btn-outline-primary:hover,
body.panel-modern .btn-outline-secondary:hover{
  background:#172a42!important;color:#fff!important;border-color:#248bff!important
}

/* Alertas e badges permanecem legíveis no fundo escuro. */
body.panel-modern .alert-info{background:#0d2945!important;color:#b9dcff!important;border-color:#1769d2!important}
body.panel-modern .alert-success{background:#0c2b21!important;color:#9ff0cb!important;border-color:#15965f!important}
body.panel-modern .alert-warning{background:#30220d!important;color:#ffd58c!important;border-color:#d97706!important}
body.panel-modern .alert-danger{background:#321419!important;color:#ffb2ba!important;border-color:#dc3545!important}
body.panel-modern .bg-primary{background:#153b68!important;color:#cce5ff!important;border-color:#248bff!important}
body.panel-modern .bg-success{background:#12382b!important;color:#b8f5d8!important;border-color:#15965f!important}
body.panel-modern .bg-danger{background:#3a171d!important;color:#ffc1c7!important;border-color:#dc3545!important}
body.panel-modern .bg-warning{background:#3a2a10!important;color:#ffe0a3!important;border-color:#d97706!important}
body.panel-modern .bg-dark{background:#111c29!important;color:#fff!important;border-color:#248bff!important}

/* Elementos específicos das telas. */
body.panel-modern .provider-pill.active{
  background:#142c49!important;border-color:#248bff!important;box-shadow:0 0 0 3px rgba(36,139,255,.13)!important
}
body.panel-modern .p2p-hero{background:linear-gradient(135deg,#0d1520,#101e30)!important}
body.panel-modern .p2p-note{background:#0d2945!important;color:#c5e3ff!important}
body.panel-modern .app-color-head{background:linear-gradient(135deg,#101a27,#0d1a2b)!important}
body.panel-modern .branding-preview,
body.panel-modern .page-content center img,
body.panel-modern .kpi-img{
  background:#09111b!important;border-color:rgba(36,139,255,.55)!important
}
body.panel-modern code,
body.panel-modern .code-output,
body.panel-modern pre{
  background:#07101a!important;color:#c9e3ff!important;border:1px solid rgba(36,139,255,.45)!important
}
body.panel-modern .swal2-popup{
  background:#0d1520!important;color:#fff!important;border-color:#248bff!important
}
body.panel-modern .swal2-title{color:#fff!important}
body.panel-modern .swal2-html-container{color:var(--panel-muted)!important}

/* Alguns estilos legados aplicam branco diretamente. */
body.panel-modern .page-content [style*="background:#fff"],
body.panel-modern .page-content [style*="background: #fff"],
body.panel-modern .page-content [style*="background:#ffffff"],
body.panel-modern .page-content [style*="background: #ffffff"]{
  background:#0d1520!important
}
body.panel-modern .page-content [style*="color:#172033"],
body.panel-modern .page-content [style*="color: #172033"],
body.panel-modern .page-content [style*="color:#111827"],
body.panel-modern .page-content [style*="color: #111827"]{
  color:#fff!important
}

@media (min-width:1025px){
  body.panel-modern .wrapper.toggled .page-footer{
    width:calc(100% - 70px)!important;
    margin-left:70px!important
  }
}
@media (max-width:1024px){
  body.panel-modern .page-footer{
    width:100%!important;
    margin-left:0!important
  }
}


/* Cobertura das classes próprias usadas nas páginas de /telas. */
body.panel-modern .page-content [class$="-card"],
body.panel-modern .page-content [class*="-card "],
body.panel-modern .pairing-card,
body.panel-modern .update-card{
  background:#0d1520!important;
  color:#f4f8ff!important;
  border-color:rgba(36,139,255,.58)!important;
}
body.panel-modern .page-content [class$="-head"],
body.panel-modern .page-content [class*="-head "],
body.panel-modern .update-head{
  background:#101a27!important;
  color:#fff!important;
  border-color:rgba(36,139,255,.4)!important;
}
body.panel-modern .pairing-form,
body.panel-modern .sensitive-row,
body.panel-modern .tutorial-step,
body.panel-modern .info-box{
  background:#09111b!important;
  color:#eef6ff!important;
  border-color:rgba(36,139,255,.5)!important;
}
body.panel-modern .pairing-copy p,
body.panel-modern .dns-title span,
body.panel-modern .tutorial-step span,
body.panel-modern .info-box,
body.panel-modern .info-box strong,
body.panel-modern .info-box a,
body.panel-modern .sensitive-row small{
  color:var(--panel-muted)!important;
}
body.panel-modern .sensitive-row strong,
body.panel-modern .tutorial-step strong,
body.panel-modern .dns-title h5{
  color:#fff!important;
}
body.panel-modern .version-note{
  background:#0d2945!important;color:#cbe5ff!important;border-color:#248bff!important;
}
