/* =============================================================
   Farthec — Componentes: modal, tabela, estados vazios, abas.
   Continuação de components.css (mantido separado para nenhum
   arquivo passar de ~300 linhas).
   ============================================================= */

/* --- Modal ------------------------------------------------- */

.modal-fundo {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--e-4);
  background: rgba(26, 29, 41, 0.5);
  backdrop-filter: blur(3px);
  animation: surgir var(--transicao) both;
}

.modal-fundo.saindo { animation: sumir var(--transicao) both; }

.modal {
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--superficie);
  border-radius: var(--raio-lg);
  box-shadow: var(--sombra-lg);
  animation: subir-modal var(--transicao-lenta) both;
}

.modal-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--e-4);
  padding: var(--e-5) var(--e-5) var(--e-3);
}

.modal-titulo { font-size: 1.2rem; font-weight: 700; }

.modal-fechar {
  color: var(--texto-fraco);
  padding: 6px;
  border-radius: var(--raio-sm);
  transition: background var(--transicao-rapida), color var(--transicao-rapida);
}

.modal-fechar:hover { background: var(--fundo-alt); color: var(--texto-forte); }

.modal-corpo { padding: 0 var(--e-5) var(--e-4); }

.modal-rodape {
  display: flex;
  justify-content: flex-end;
  gap: var(--e-2);
  padding: var(--e-3) var(--e-5) var(--e-5);
}

@keyframes surgir { from { opacity: 0; } to { opacity: 1; } }
@keyframes sumir  { to   { opacity: 0; } }

@keyframes subir-modal {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

@media (max-width: 520px) {
  /* No celular o modal vira uma folha que sobe de baixo. */
  .modal-fundo { align-items: flex-end; padding: 0; }

  .modal {
    max-width: none;
    border-radius: var(--raio-lg) var(--raio-lg) 0 0;
    animation: subir-folha var(--transicao-lenta) both;
  }

  @keyframes subir-folha {
    from { transform: translateY(100%); }
    to   { transform: none; }
  }

  .modal-rodape { flex-direction: column-reverse; }
  .modal-rodape .btn { width: 100%; }
}

/* --- Tabela ------------------------------------------------ */

.tabela-caixa {
  background: var(--superficie);
  border: 1px solid var(--borda);
  border-radius: var(--raio-lg);
  overflow: hidden;
}

/* O wrapper rola sozinho; a página nunca rola na horizontal. */
.tabela-rolagem { overflow-x: auto; }

.tabela {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 560px;
}

.tabela thead th {
  padding: 14px var(--e-4);
  text-align: left;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--texto-fraco);
  background: var(--fundo);
  border-bottom: 1px solid var(--borda);
  white-space: nowrap;
}

.tabela tbody td {
  padding: 14px var(--e-4);
  border-bottom: 1px solid var(--borda);
  vertical-align: middle;
}

.tabela tbody tr:last-child td { border-bottom: none; }

.tabela tbody tr {
  transition: background var(--transicao-rapida);
}

.tabela tbody tr:hover { background: var(--fundo); }

.tabela-clicavel tbody tr { cursor: pointer; }

/* --- Estado vazio ------------------------------------------ */

.vazio {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--e-8) var(--e-5);
  color: var(--texto-suave);
}

.vazio-icone {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--fundo-alt);
  color: var(--azul-600);
  margin-bottom: var(--e-4);
}

.vazio-titulo {
  font-weight: 600;
  color: var(--texto-forte);
  margin-bottom: var(--e-1);
}

.vazio-texto { font-size: 0.9rem; max-width: 40ch; margin-bottom: var(--e-4); }

/* --- Abas -------------------------------------------------- */

.abas {
  display: flex;
  gap: var(--e-1);
  border-bottom: 1px solid var(--borda);
  margin-bottom: var(--e-5);
  overflow-x: auto;
}

.aba {
  padding: 10px var(--e-4);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--texto-suave);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color var(--transicao-rapida), border-color var(--transicao-rapida);
}

.aba:hover { color: var(--texto-forte); }

.aba[aria-selected='true'] {
  color: var(--azul-600);
  border-bottom-color: var(--azul-600);
}

/* --- Barra de progresso ------------------------------------ */

.progresso-trilho {
  height: 8px;
  background: var(--fundo-alt);
  border-radius: var(--raio-full);
  overflow: hidden;
}

.progresso-barra {
  height: 100%;
  background: var(--gradiente-primario);
  border-radius: var(--raio-full);
  /* Anima do valor antigo ao novo quando o admin atualiza o progresso. */
  transition: width var(--transicao-lenta);
}
