/* Painel: ajustes globais, responsividade e barra de rolagem (preta com azul). */

/* ---------- barra de rolagem global (Chrome/Edge/Safari e Firefox; vale também p/ tabelas e modais) ---------- */
* {
  scrollbar-width: thin;                 /* Firefox */
  scrollbar-color: #1e90ff #000000;      /* Firefox: polegar azul, trilho preto */
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
  background: #000000;
}
*::-webkit-scrollbar-track {
  background: #000000;
}
*::-webkit-scrollbar-thumb {
  background: #1e90ff;
  border-radius: 6px;
  border: 2px solid #000000;
}
*::-webkit-scrollbar-thumb:hover {
  background: #4aa8ff;
}
*::-webkit-scrollbar-corner {
  background: #000000;
}

/* ---------- base ---------- */
html, body {
  max-width: 100%;
}
body {
  background: linear-gradient(180deg, #0f2027, #203a43, #0f2027) fixed;
  color: #fff;
  min-height: 100vh;
  overflow-x: hidden;                    /* a página nunca rola na horizontal; tabelas rolam por dentro */
}
#sidebar-wrapper {
  background: linear-gradient(180deg, #0f2027, #203a43, #0f2027);
}
#sidebar-wrapper .sidebar-heading {
  word-break: break-word;
}
.span-txt {
  display: block;
  margin: 10px 0 4px 10px;
  font-size: .85rem;
  opacity: .8;
  text-transform: uppercase;
  letter-spacing: .04em;
}
#sidebar-wrapper .list-group-item.active {
  border-left: 3px solid #1e90ff;
}
.painel-flash {
  position: relative;
  margin-bottom: 1rem;
}
.painel-flash .close {
  position: absolute;
  top: 6px;
  right: 8px;
}
.card .card-header h2,
.card .card-header h3 {
  margin: 0;
  text-align: center;
}
.card, .card-body {
  min-width: 0;                          /* evita que conteúdo largo estique o layout */
}
img, video, iframe {
  max-width: 100%;
}
.img-fluid {
  height: auto;
}
.card-body label {
  color: #fff;
}
code {
  word-break: break-all;
}

/* ---------- tabelas: rolam por dentro, com largura mínima ---------- */
.table-responsive {
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.table-responsive > .table {
  min-width: 640px;
  margin-bottom: 0;
}
.table td, .table th {
  vertical-align: middle;
}
.table td.url-col {
  word-break: break-all;
}
.table .col-check {
  width: 36px;
}

/* barra de ações no topo das listas */
.acoes-topo {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .5rem;
}
.acoes-topo form {
  margin: 0;
}

/* ---------- modais ---------- */
.modal-content {
  background: #1b2d36;
  color: #fff;
  border: 1px solid #2f4856;
}
.modal-body {
  overflow-wrap: anywhere;
}
.modal {
  overflow-y: auto;
}

/* ---------- celular e tablet estreito ---------- */
@media (max-width: 767.98px) {
  /* menu vira gaveta sobre o conteúdo (não empurra a página) */
  #sidebar-wrapper {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1040;
    overflow-y: auto;
    margin-left: -15rem;
  }
  #wrapper.toggled #sidebar-wrapper {
    margin-left: 0;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .55);
  }
  #page-content-wrapper {
    min-width: 0;
    width: 100%;
  }
  .container-fluid {
    padding-left: 12px;
    padding-right: 12px;
  }
  .card-body {
    padding: 1rem .75rem;
  }
  /* títulos e botões centralizados / empilhados */
  .card-header {
    text-align: center;
  }
  .card .card-header h2,
  .card .card-header h3 {
    font-size: 1.35rem;
  }
  .acoes-topo {
    flex-direction: column;
    align-items: stretch;
  }
  .acoes-topo .btn,
  .acoes-topo form .btn {
    width: 100%;
  }
  .btn-center-sm .btn,
  .form-actions .btn {
    display: block;
    width: 100%;
    margin: .35rem 0;
  }
  .modal-dialog {
    margin: .5rem;
  }
  .modal-footer {
    flex-direction: column-reverse;
  }
  .modal-footer .btn {
    width: 100%;
    margin: .25rem 0;
  }
}

@media (max-width: 575.98px) {
  .dataTables_wrapper .dataTables_length,
  .dataTables_wrapper .dataTables_filter {
    text-align: center;
  }
}
