/* ===============================
   Paleta de cores
   =============================== */
:root {
  --blue-primary:    #005D7A;
  --blue-primary-dk: #00465E;
  --gray-light:      #F8F9FA;
  --gray-mid:        #E9ECEF;
  --gray-dark:       #6C757D;
  --border:          #DEE2E6;
  --accent-warning:  #FFC107;
  --success:         #28A745;
  --danger:          #DC3545;
}

/* ===============================
   1) Reset / base
   =============================== */
#painel-content {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 20px;
}

/* ===============================
   2) Filtros container
   =============================== */
.filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.filtro {
  position: relative;  /* stacking context para z-index */
  z-index: 0;
}

.filtro label {
  font-weight: bold;
  display: block;
  margin-bottom: 4px;
}

/* ===============================
   3) Dropdown (combo + seta + badge)
   =============================== */
.filtro .dropdown {
  display: inline-flex;      /* encolhe ao conteúdo */
  align-items: center;       /* vertical centering */
  position: relative;
  min-width: 120px;          /* largura mínima */
  width: 100%;               /* preenche a célula sem ultrapassar */
  padding: 0.4em 0.6em;
  box-sizing: border-box;
  border: 1px solid var(--border);
  background: #fff;
  cursor: pointer;
  min-width: 0;              /* ESSENCIAL para flex encolher */
}

.filtro .dropdown .label {
  order: 0;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 0.5em;
}

.filtro .dropdown::before {
  content: "";
  order: 1;
  flex: none;
  width: 0;
  height: 0;
  margin: 0 0.5em;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--gray-dark);
}

.filtro .dropdown .count {
  order: 2;
  flex: none;
  background: var(--danger);
  color: #fff;
  font-size: 1em;
  line-height: 1;
  padding: 0.2em 0.5em;
  border-radius: 1em;
  z-index: 1; /* acima da seta */
}

/* ===============================
   4) Lista de checkboxes
   =============================== */
.filtro .checkboxes {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
  box-sizing: border-box;
  z-index: 101;
}

.filtro.open .checkboxes {
  display: block;
}

.checkboxes .filter-search {
  width: 100%;
  padding: 4px 6px;
  margin-bottom: 6px;
  border: 1px solid var(--border);
  border-radius: 3px;
  box-sizing: border-box;
}

.checkboxes label {
  display: block;
  margin: 4px 0;
}

/* ===============================
   5) DataTable geral
   =============================== */
#tabela {
  width: 100%;
  font-size: 10px;
  text-transform: uppercase;
  table-layout: fixed;
}

table.display {
  border-collapse: collapse;
}

table.display th,
 table.display td {
  border: 1px solid var(--border);
}

table.display thead th {
  background-color: var(--gray-mid);
  border-bottom: 2px solid var(--border);
  color: var(--gray-dark);
}

table.display.stripe tbody tr:nth-child(odd) {
  background-color: var(--gray-light);
}

table.display tr.selected,
 table.display tr:hover.selected {
  background: rgba(0,93,122,0.1);
}

/* ===============================
   6) Spinner de carregamento
   =============================== */
.hidden {
  display: none;
}

#loading-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: #fff;
  display: flex;
  flex-direction: column;      /* empilha logo + spinner */
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 6px solid #eee;
  border-top: 6px solid var(--blue-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.spinner-message {
  font-size: 16px;
  color: #333;
  font-weight: 500;
  text-align: center;
}

.spinner-logo {

  height: auto;
  /* antes estava em 1rem, vamos aumentar um pouco: */
  margin-bottom: 2rem;
}
/* ===============================
   7) Overflow e z-index para dropdown
   =============================== */
.filters-row th,
 #tabela th {
  overflow: visible;
}

.filtro.open {
  z-index: 100;
}

/* ===============================
   Action Buttons
   =============================== */
.action-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin: 1rem 0;
}

.action-buttons button {
  padding: 0.4em 0.8em;
  font-size: 0.875rem;
  border-radius: 4px;
  min-width: 8em;
  cursor: pointer;
  background-color: var(--blue-primary);
  color: #fff;
  border: none;
  transition: background-color .2s;
}

.action-buttons button:hover {
  background-color: var(--blue-primary-dk);
}

/* ===============================
   DataTables – fonte e alinhamentos
   =============================== */
.dataTables_wrapper {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.dataTables_wrapper .dataTables_length {
  float: right;
  margin-bottom: 1em;
}

.dataTables_wrapper .dataTables_info {
  float: left;
  color: var(--gray-dark);
}

.dataTables_wrapper .dataTables_paginate {
  float: right;
  margin-top: 0.5em;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--blue-primary);
  color: #fff !important;
  border: none;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: var(--blue-primary-dk);
}

.dataTables_wrapper .dataTables_length select {
  font-size: 0.875rem;
  font-family: inherit;
  border: 1px solid var(--border);
  background: #fff;
  color: #212529;
}
/* Ajustes finos (tamanho, caso queira) */
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_paginate {
  font-size: 0.875rem;    /* ex.: 14px */
  font-family: inherit;   /* herda do .dataTables_wrapper acima */
}

/* E no select da quantidade de linhas */
.dataTables_wrapper .dataTables_length select {
  font-size: 0.875rem;
  font-family: inherit;
}

table.display thead > tr:first-child th {
  background-color: #00577B;
  color: #fff;
  border: none;
  font-size: 0.875rem;
  text-transform: none;
}

.ultima-atualizacao {
  float: left;
  margin: 0.6em 1em 0.6em 0;  /* topo, direita, baixo, esquerda */
  font-size: 0.875rem;        /* 14px se 1rem = 16px */
  font-family: inherit;       /* mesma família do wrapper */
  color: var(--gray-dark);
}