body {
  background: #f5f7fa;
  font-size: .8rem;
  margin:0;
  display: flex;
  flex-direction: column;
}

.header {
  flex: 1 0 10%;
  
}

.content {
    flex: auto;
    max-height: 420px;
    overflow-y: auto;
}

.scrollable{
  padding: 10 0 5 0;
  overflow-y: scroll;
}

.first-color { 
	background: #373e48; 
}
	
.second-color { 
	background: #455d7a; 
}

.third-color { 
	background: #f95959; 
}

.fourth-color { 
	background: #e3e3e3; 
}

a {
  text-decoration: none;
  color: inherit;
}

a:visited {
  text-decoration: none;
  color: inherit;
}

a:hover {
  color: inherit;
}

small {
  font-size: .650rem;
  text-transform: none;
  color: gray;
}

.miniTexto {
  font-size: .800rem;
  margin-top: 0;
  width: 100%;
  padding-bottom: .45rem;
  border-bottom: 1px solid silver;
}

.borda1 {
  padding: 2px 4px 2px 4px;
  margin: 4px 4px 4px 4px;
  border: 1px solid silver;
  border-radius: 4px;
}

.fundo-cinza {
  background-color: #F8F8FF;
}

.fundo-azul {
  background-color: rgb(206, 231, 245);
}

.btn-primary:visited {
    color: white !important;
}

.btn-secondary:visited {
    color: white !important;
}

.btn-success:visited {
    color: white !important;
}

.btn-danger:visited {
    color: white !important;
}


/*
 * Navbar
 */

.navbar-custom {
  background-color: #373e48;
  color: #ffffff;
  font-size: .86rem;
}

/* Optional: customize link colors for the custom navbar */
.navbar-custom .navbar-nav .nav-link {
  color: #ffffff;
}

.navbar-custom .navbar-nav .nav-link:hover {
  color: #cccccc;
}

.navbar .navbar-toggler {
  top: .25rem;
  right: 1rem;
}

.navbar .form-control {
  padding: .75rem 1rem;
  border-width: 0.25rem;
  border-radius: 0.25rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}


/* ===========================
   SIDEBAR 
   =========================== */

.sidebar {
  background: #fff;
}  

/* Mobile: sidebar como overlay */
.sidebar-mobile {
  position: fixed;
  top: 52px;                 /* altura da topbar */
  left: 0;
  width: 280px;
  height: calc(100vh - 54px);  /* altura total da tela menos topbar */
  overflow-y: auto;
  z-index: 1045;             /* acima do conteúdo */
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* Backdrop escurecido quando abrir */
.sidebar-backdrop {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  bottom: 0px; 
  background: rgba(0,0,0,.25);
  z-index: 1040;
  display: none;
}

.sidebar-backdrop.show {
  display: block;
}

/* Sidebar: garante altura e scroll interno */
#sidebarMenu .sidebar {
  height: 100%;

}

#sidebarMenu .sidebar > ul.nav.flex-column.mt-2 {
  overflow-y: auto;
  flex: 1;
  padding-bottom: .5rem;
}

/* Desktop: sidebar alta e com scroll interno */
@media (min-width: 768px) {
  .sidebar-col {
    background: #fff;
    border-right: 1px solid #e9ecef;
  }

  .sidebar {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 52px - 42px); /* estica até o topo do footer */
    background: transparent;
    border-right: 0;
  }
  .sidebar > ul.nav.flex-column.mt-2 {
    flex: 1;
    overflow-y: visible;
  }
}

@media (max-width: 767.98px) {
  /* O nav #sidebarMenu vira overlay no mobile */
  #sidebarMenu {
    position: fixed;
    top: 52px;
    left: 0;
    width: 280px;
    height: calc(100vh - 52px);
    background: #fff;
    z-index: 1045;
    overflow-y: auto;
    border-right: 1px solid #e9ecef;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
  }

  /* Quando está colapsado (fechado), some de verdade */
  #sidebarMenu:not(.show) {
    display: none;
  }

  /* remove sticky no mobile */
  #sidebarMenu .position-sticky {
    position: static !important;
  }

  .sidebar {
    top: 5rem;
  }
  .card .btn-group-sm .btn {
    padding: .25rem .45rem;
  }
  .table {
    font-size: 0.85rem;
  }
  .dataTables_filter input {
    width: 100%;
  }

}


/* Blindagem: UL não cria recuo escondido */
.sidebar ul.nav {
  padding-left: 0;
  margin-left: 0;
}

/* Topo empresa */
.sidebar-empresa .empresa-fantasia {
  font-weight: 600;
  font-size: .90rem;
}

.sidebar-empresa .empresa-razao {
  font-size: .58rem;
  color: #6c757d;
}

/* Links padrão */
.sidebar .nav-link {
  color: #343a40;
  padding: .4rem .75rem;
  transition: all 0.15s ease-in-out;
}

/* Hover */
.sidebar .nav-link:hover {
  background-color: #dee2e6;
  color: #212529;
}

/* Link ativo */
.sidebar .nav-link.active {
  color: #455d7a !important;
  font-weight: 500;
}

/* ===========================
   Módulos (header + collapse)
   =========================== */

/* Wrapper do header do módulo: sem padding aqui (evita desalinhamento) */

.sidebar .modulo-header .nav-link {
  padding: .35rem .75rem;
}

.sidebar .collapse-toggle {
  margin-right: .35rem;
}

/* Ícones alinhados (coluna) */
.sidebar .modulo-header i,
.sidebar .submenu .nav-link i {
  width: 18px;
  text-align: center;
}

/* Botão chevron */
.sidebar .collapse-toggle {
  padding: .15rem .35rem;
  opacity: .65;
}

.sidebar .collapse-toggle:hover {
  background: rgba(0,0,0,.06);
  opacity: 1;
}

.sidebar .collapse-toggle i {
  color: #6c757d;
  font-size: .9rem;
}

.sidebar .collapse-toggle:hover i {
  color: #212529;
}

.sidebar .collapse-toggle:focus,
.sidebar .collapse-toggle:focus-visible {
  outline: none;
  box-shadow: none;
}

/* ===========================
   Submenu
   =========================== */

.sidebar .submenu {
  padding-left: .75rem; /* ajuste fino do recuo */
}

/* Links do submenu: um pouco mais “compactos” */
.sidebar .submenu .nav-link {
  padding: .34rem .72rem;
  font-size: 0.74rem;
}

/* Ícones do submenu com leve transparência */
.sidebar .submenu .nav-link i {
  opacity: .8;
}

/* Submenu ativo (mais leve que o active azul sólido) */
.sidebar .submenu .nav-link.active {
  background-color: rgba(13, 110, 253, 0.12);
  color: #455d7a;
  font-weight: 500;
}

/* Heading dentro do submenu (menus tipo=1) */
.sidebar .submenu-heading {
  font-size: 0.78rem;
  font-weight: 700;
  color: #6c757d;
  padding: .45rem .75rem .15rem;
  letter-spacing: .02em;
}

/* ===========================
   Separador
   =========================== */


.sidebar .sidebar-sep {
  opacity: .08;
  margin: .75rem .75rem;
}

.list-group .list-group-item:hover {
  color: white;
  background-color: #455d7a;
}

.list-group .list-group-item.a:link {
  color: #E5E8E8;
}

.form-label {
  margin-bottom: 3px;
}

:root {
  --dd-compact-control-height: 2rem;
  --dd-compact-control-radius: .375rem;
  --dd-compact-control-padding-y: .35rem;
  --dd-compact-control-padding-x: .65rem;
}

.form-control {
  font-size: .72rem;
  padding: .2rem .4rem .2rem .4 rem;
  border-radius: .5rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-select {
  padding-right: 3rem !important; /* Forces a gap on the right */
  background-position: right 1rem center !important; /* Re-aligns the chevron */
  font-size: .72rem;
  border-radius: .5rem;
  border-color: silver;
}


.form-control-dark {
  color: #fff;
  background-color: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .1);
}

.form-control-dark:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}

.form-control-sm,
.form-select-sm {
  height: var(--dd-compact-control-height);
  min-height: var(--dd-compact-control-height);
  padding: var(--dd-compact-control-padding-y) var(--dd-compact-control-padding-x);
  border-radius: var(--dd-compact-control-radius);
}

.btn-sm {
  height: var(--dd-compact-control-height);
  min-height: var(--dd-compact-control-height);
  padding: var(--dd-compact-control-padding-y) .75rem;
  border-radius: var(--dd-compact-control-radius);
}

/* Mantem filtros compactos com altura e arredondamento consistentes, inclusive em input-groups. */
.input-group-sm {
  min-height: var(--dd-compact-control-height);
}

.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .input-group-text,
.input-group-sm > .btn {
  height: var(--dd-compact-control-height);
  min-height: var(--dd-compact-control-height);
  border-radius: var(--dd-compact-control-radius);
}

.input-group-sm > .form-control,
.input-group-sm > .form-select,
.input-group-sm > .btn {
  padding-top: var(--dd-compact-control-padding-y);
  padding-bottom: var(--dd-compact-control-padding-y);
}

.input-group-sm > .input-group-text {
  padding: var(--dd-compact-control-padding-y) var(--dd-compact-control-padding-x);
  align-items: center;
  line-height: 1;
}

.input-group-sm > :not(:first-child) {
  border-top-left-radius: var(--dd-compact-control-radius);
  border-bottom-left-radius: var(--dd-compact-control-radius);
}

.input-group-sm > :not(:last-child) {
  border-top-right-radius: var(--dd-compact-control-radius);
  border-bottom-right-radius: var(--dd-compact-control-radius);
}

/* Ajuste global para selects de paginação (evita chevron sobre o número). */
.pp-select {
  width: auto;
  min-width: 4.25rem;
  padding-right: 1.75rem;
}

@media (max-width: 767.98px) {
  :root {
    --dd-compact-control-height: 2.05rem;
  }
}

.inputLocate {
  background-image: url('/static/img/search.svg');
  background-position: 6px 6px; /* Position the search icon */
  background-repeat: no-repeat; /* Do not repeat the icon image */
  width: 100%; /* Full-width */
  font-size: .72rem; /* Increase font-size */
  padding: 8px 20px 8px 40px; /* Add some padding */
  border: 1px solid silver; /* Add a grey border */
  border-radius: 4px;
  margin-bottom: 12px; /* Add some space below the input */
}

.inputLocate:focus {
  color: #212529;
  background-color: #fff;
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.breadcrumb {
  background: transparent;
  padding: .4rem 0;
  color: #373e48;
  font-size: .80rem;  
  border-bottom: 1px solid #e9ecef; 
}

.breadcrumb-item.a:visited {
  color: #373e48;
}

.breadcrumb-item.a:link {
  color: #373e48;
}

.breadcrumb-item.a:hover {
  background-color: rgba(0,0,0,0.05);
}

.breadcrumb-item.active {
  color: #373e48; 
  font-weight: 500;
}

.arr-right .breadcrumb-item+.breadcrumb-item::before {
  content: "›";
  vertical-align: top;
  color: #373e48;
  font-size: .98rem;
  line-height: 20px;
}

.dropdown-item {
  color: #212529;
  text-align: left;
  padding: .25rem 1.5rem;
  text-decoration: none;
  display: block;
  font-size: .800rem;
}

.dropdown-item:hover {
  color: white;
  background-color: #455d7a;
  font-size: .800rem;
}

.show {
  display: block;
}

.dashboard-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0.75rem rgba(0, 0, 0, 0.05);
}

.icon-container i {
  font-size: 2rem;
  color: #455d7a;
}

.form-signin {
  width: 100%;
  max-width: 360px;
  padding: 20px;
  margin: auto;
  margin-top: 20px;
  background: #e3e3e3;
  border: 1px solid transparent;
  border-radius: 5px;
  box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);
}

.form-signin .logo {
  text-align: center;
  margin: 10px 0px 20px 0px;
  padding: 8px;
}

.form-signin .checkbox {
  font-weight: 400;
}

.form-signin .form-control {
  position: relative;
  box-sizing: border-box;
  height: auto;
  padding: 6px ;
  font-size: 12px;
}

.form-signin .form-control:focus {
  z-index: 2;
}

.form-signin input[type="email"] {
  margin-bottom: -1px;
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
}

.form-signin input[type="password"] {
  margin-bottom: 10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
}

.coluna-5 {
  width: 5%;
}

.coluna-10 {
  width: 10%;
}

.coluna-20 {
  width: 20%;
}

.coluna-30 {
  width: 30%;
}

.coluna-40 {
  width: 40%;
}

.coluna-50 {
  width: 50%;
}

.coluna-60 {
  width: 60%;
}

.coluna-70 {
  width: 70%;
}

.coluna-80 {
  width: 80%;
}

.coluna-90 {
  width: 90%;
}

.coluna-100 {
  width: 100%;
}


/* Evita o "flash" do select nativo antes do DAL inicializar o Select2. */
select[data-autocomplete-light-function] {
  visibility: hidden;
}

select[data-autocomplete-light-function] + .select2-container--bootstrap-5 {
  visibility: visible;
}

/* Alinha o Select2 com o padrao visual dos campos do sistema. */
.select2-container--bootstrap-5 .select2-selection,
.form-select ~ .select2-container--bootstrap-5 .select2-selection,
.form-select-sm ~ .select2-container--bootstrap-5 .select2-selection {
  min-height: var(--dd-compact-control-height);
  border-radius: var(--dd-compact-control-radius);
  font-size: .8rem;
}

.select2-container--bootstrap-5,
.form-select ~ .select2-container--bootstrap-5,
.form-select-sm ~ .select2-container--bootstrap-5 {
  min-height: var(--dd-compact-control-height);
}

.select2-container--bootstrap-5 .select2-selection--single,
.form-select ~ .select2-container--bootstrap-5 .select2-selection--single,
.form-select-sm ~ .select2-container--bootstrap-5 .select2-selection--single {
  display: flex;
  align-items: center;
  height: var(--dd-compact-control-height);
  min-height: var(--dd-compact-control-height);
  padding: var(--dd-compact-control-padding-y) 2rem var(--dd-compact-control-padding-y) var(--dd-compact-control-padding-x);
}

.select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
.form-select ~ .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered,
.form-select-sm ~ .select2-container--bootstrap-5 .select2-selection--single .select2-selection__rendered {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 100%;
  line-height: calc(var(--dd-compact-control-height) - (2 * var(--dd-compact-control-padding-y)) - 2px);
  color: #212529;
}

.select2-container--bootstrap-5 .select2-dropdown,
.select2-container--bootstrap-5 .select2-dropdown .select2-search,
.select2-container--bootstrap-5 .select2-dropdown .select2-search .select2-search__field,
.select2-container--bootstrap-5 .select2-dropdown .select2-results__option {
  font-size: .8rem;
}

.htmx-indicator {
  display: none;
}

.htmx-request .htmx-indicator {
  display: flex;
}

/* Cards do painel Configurações */
.config-card {
  border-radius: 1rem;
}

.config-card:hover {
  transform: translateY(-1px);
  transition: transform .12s ease-in-out;
}

.config-card-icon {
  width: 42px;
  height: 42px;
  border-radius: .9rem;
  background: rgba(13, 110, 253, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.config-card-icon i {
  font-size: 1.2rem;
  color: #0d6efd;
}

/* ========================================
   TABELAS PADRÃO DO SISTEMA (Dartdata)
======================================== */

.table {
  font-size: 0.72rem;
  color: #343a40;
}

/* Cabeçalho */
.table thead th {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: #6c757d;
  background-color: #b8c1cc;
  border: none;
  padding-top: .55rem;
  padding-bottom: .55rem;
  white-space: nowrap;
}

/* Linhas */
.table tbody td {
  padding-top: .55rem;
  padding-bottom: .55rem;
  vertical-align: middle;
}

/* Hover suave */
.table-hover tbody tr:hover {
  background-color: #f8f9fa;
}

/* Espaço para ações */
.table td:last-child {
  width: 90px;
}

/* ========================================
   BADGES
======================================== */

.badge.text-bg-success {
  color: #fff !important;
  background-color: #198754 !important;
}

.badge.text-bg-danger {
  color: #fff !important;
  background-color: #dc3545 !important;
}

.badge.text-bg-warning {
  color: #212529 !important;
  background-color: #ffc107 !important;
}

.badge.text-bg-secondary {
  color: #fff !important;
  background-color: #6c757d !important;
}

.badge.text-bg-light {
  color: #212529 !important;
  background-color: #f8f9fa !important;
  border: 1px solid #dee2e6;
}

.table .badge {
  font-size: 0.72rem;
  font-weight: 500;
  padding: .32rem .5rem;
  border-radius: .35rem;
}

/* ========================================
   BOTÕES NA TABELA
======================================== */

.table .btn-group-sm .btn {
  padding: .22rem .42rem;
}

.table .btn {
  border-radius: .4rem;
}

/* ========================================
   DATATABLES
======================================== */

.dataTables_filter {
  margin-bottom: .2rem;
}

.dataTables_filter input {
  width: 260px;
  font-size: 0.88rem;
  border-radius: .45rem;
  border: 1px solid #ced4da;
  padding: .32rem .55rem;
  transition: all .15s ease;
}

.dataTables_filter input:focus {
  border-color: #86b7fe;
  box-shadow: 0 0 0 .1rem rgba(13,110,253,.15);
  outline: none;
}

/* remove "Search:" */
.dataTables_filter label {
  font-weight: 500;
  color: #495057;
}

/* ========================================
   CARDS COM TABELA
======================================== */

.card.table-card {
  background: #fff;
  border: 1px solid #e6e8eb;
  border-radius: .75rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.06);
}

.card.table-card h4 {
  font-size: 1.1rem;
  font-weight: 600;
}

/* ========================================
   MOBILE
======================================== */

.dataTables_filter {
  float: left;   
}


/* ==============================
   CARD DA TABELA
============================== */

.card.table-card {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: .75rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.05);
}

.card.table-card {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: .75rem;
  box-shadow: 0 3px 10px rgba(0,0,0,.05);
}

/* Título do card */
.card.table-card h4 {
  font-weight: 600;
}

.perm-section {
  border-top: 1px solid #eef1f4;
}

.perm-section-header {
  background: #f8f9fa;
  padding: .65rem .85rem;
}

.perm-section-header .btn {
  font-size: .72rem;
}

.perm-matrix .table td,
.perm-matrix .table th {
  font-size: .85rem;
}

/* ===========================
   MATRIZ DE PERMISSÕES
   =========================== */

.perm-matrix table {
  table-layout: fixed;
}

.perm-matrix thead th {
  font-size: .75rem;
  letter-spacing: .03em;
  text-transform: uppercase;
}

/* colunas de permissões */
.perm-matrix th.text-center,
.perm-matrix td.text-center {
  width: 90px;
  text-align: center;
  vertical-align: middle;
}

/* checkbox centralizado */
.perm-matrix input.form-check-input {
  display: block;
  margin: auto;
  transform: scale(1.05);
}

/* coluna MENU maior */
.perm-matrix th:first-child,
.perm-matrix td:first-child {
  width: auto;
}

.perm-copy-box {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
}

.perm-copy-box label {
  font-size: .8rem;
  color: #6c757d;
}

.sortable {
    cursor: pointer;
}

.sortable:hover {
    background-color: rgba(0,0,0,0.05);
}
