/* ===========================
   BASE E RESET
=========================== */
body {
  font-family: Arial, sans-serif;
  background: #f4f6f8;
  margin: 0;
  color: #333;
}

/* ===========================
   TIPOGRAFIA E ELEMENTOS GERAIS
=========================== */
h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

p {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1rem;
  color: #666;
}

a {
  display: block;
  margin-top: 1rem;
  text-align: center;
  color: #003366;
  text-decoration: none;
}

/* ===========================
   FORMULÁRIOS
=========================== */
.form-container,
.login-container,
.container {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
  max-width: 500px;
  margin: 2rem auto;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  display: block;
  margin-top: 1rem;
  font-weight: bold;
}

input {
  width: 100%;
  padding: 0.6rem;
  margin-top: 0.3rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
}

button {
  margin-top: 1.5rem;
  padding: 0.8rem;
  background-color: #003366;
  color: white;
  border: none;
  border-radius: 5px;
  font-weight: bold;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover {
  background-color: #002244;
}

/* ===========================
   MENSAGENS DE STATUS
=========================== */
.erro {
  background: #ffe0e0;
  color: #a00;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.sucesso {
  background: #e0ffe0;
  color: #080;
  padding: 0.75rem;
  border-radius: 4px;
  margin-bottom: 1rem;
}

/* ===========================
   PAINEL E DASHBOARD
=========================== */
.topbar {
  background: #003366;
  color: white;
  padding: 0.2rem 1rem;
  height: 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.rep-nome {
  font-weight: bold;
  font-size: 0.8rem;
}

.dashboard {
  padding: 2rem;
}

.stats {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.card {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0,0,0,0.1);
  flex: 1;
  min-width: 200px;
  text-align: center;
}

.card h2 {
  margin-bottom: 0.5rem;
}

.actions {
  margin-top: 1.2rem;
  display: flex;
  gap: 1rem;
}

.btn {
  background: #003366;
  color: white;
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 5px;
  font-weight: bold;
}

.btn.small {
  padding: .4rem .6rem;
  font-size: .9rem;
}

.btn.small.muted {
  background: #eee;
  color: #333;
  border: 1px solid #ccc;
  border-radius: 4px;
}

/* ===========================
   TABELAS
=========================== */
.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.clientes-table,
.consorcios-table,
.grupos-table {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

.clientes-table td,
.clientes-table th,
.consorcios-table td,
.consorcios-table th,
.grupos-table td,
.grupos-table th {
  border: 1px solid #ddd;
  padding: 8px;
}

.clientes-table tr:nth-child(even),
.consorcios-table tr:nth-child(even),
.grupos-table tr:nth-child(even) {
  background-color: #f9fafb;
}

.clientes-table tr:hover,
.consorcios-table tr:hover,
.grupos-table tr:hover {
  background-color: #eef2f6;
}

.clientes-table th,
.consorcios-table th,
.grupos-table th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #003366;
  color: white;
}

/* ===========================
   FILTROS E PAGINAÇÃO
=========================== */

.filtros {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.75rem;
  align-items: end;
}

.filtros h3 {
  grid-column: 1 / -1;
  margin-bottom: 0.5rem;
}

/* ===========================
   RESUMO (adicional para grupos)
=========================== */
.resumo {
  background: #eef2f6;
  padding: 0.75rem 1rem;
  border-radius: 5px;
  margin: 1rem 0;
  font-size: 0.95rem;
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  align-items: center;
}

.resumo strong {
  color: #003366;
}

/* ===========================
   SEÇÃO DE GRUPOS (adicional)
=========================== */
.grupos-section {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  margin: 1.5rem auto;
  max-width: 1200px;
}

/* ===========================
   PAGINAÇÃO
=========================== */
.paginacao {
  text-align: center;
  margin-top: .75rem;
}

.paginacao span {
  display: inline-block;
  margin: 2px;
}

.paginacao a {
  display: inline-block;
  padding: 6px 12px;
  margin: 2px;
  background: #003366;
  color: white;
  border-radius: 4px;
  text-decoration: none;
}
.paginacao a.ativa {
  background: #ffcc00;
  color: #003366;
}

/* ===========================
   DROPDOWN E MENU
=========================== */
.user-menu {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dropdown {
  position: relative;
}

.menu-btn {
  background: #ffcc00;
  border: none;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 4px;
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  top: 110%;
  background-color: white;
  min-width: 150px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  z-index: 1;
  border-radius: 4px;
}

.dropdown-content a {
  color: #003366;
  padding: 0.75rem 1rem;
  text-decoration: none;
  display: block;
}

.dropdown-content a:hover {
  background-color: #f0f0f0;
}

.dropdown:hover .dropdown-content {
  display: block;
}

/* ===========================
   RODAPÉ
=========================== */
.rodape {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  text-align: center;
  padding: 1rem;
  background: #eaeaea;
  font-size: 0.9rem;
  color: #333;
  border-top: 1px solid #ccc;
  z-index: 1000;
}

/* ===========================
   MOBILE RESPONSIVO
=========================== */
@media screen and (max-width: 768px) {
  body {
    font-size: 16px;
    margin: 0;
    padding: 0;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    padding: 10px;
  }

  .topbar h1 {
    font-size: 1em;
    margin: 0;
    margin-bottom: 10px;
  }

  .user-menu {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .dashboard {
    padding: 10px;
  }

  .stats {
    flex-direction: column;
    gap: 10px;
  }

  .card {
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
  }

  .actions {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

  .btn {
    font-size: 1em;
    padding: 10px;
    text-align: center;
  }

  .clientes,
  .consorcios,
  .grupos-section {
    overflow-x: auto;
  }

  .filtros {
    flex-direction: column;
    align-items: stretch;
  }

  .filtros input,
  .filtros select,
  .filtros button,
  .filtros a {
    width: 100%;
    max-width: none;
  }

  .rodape {
    padding: 10px;
  }

  .resumo {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }
}

/* ===========================
   TABELA DE AGÊNCIAS
=========================== */
.agencias-table {
  font-family: Arial, Helvetica, sans-serif;
  border-collapse: collapse;
  width: 100%;
}

.agencias-table td,
.agencias-table th {
  border: 1px solid #ddd;
  padding: 8px;
}

.agencias-table tr:nth-child(even) {
  background-color: #f9fafb;
}

.agencias-table tr:hover {
  background-color: #eef2f6;
}

.agencias-table th {
  padding-top: 12px;
  padding-bottom: 12px;
  text-align: left;
  background-color: #003366;
  color: white;
}

/* ===========================
   ICONE DE LINK (para edição)
=========================== */
.icon-link {
  display: inline-block;
  text-decoration: none;
  font-size: 1.2rem;
  margin: 0;
  padding: 0 4px;
}

/* ===========================
   FILTROS EM LINHA
=========================== */
.filtros-inline {
  display: flex;
  flex-wrap: nowrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 6px;
  border: 1px solid #e9ecef;
}

.filtro-grupo {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.filtro-grupo label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filtro-grupo select {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ced4da;
  border-radius: 4px;
  font-size: 0.9rem;
  background: white;
  width: 100%;
  transition: border-color 0.15s ease-in-out;
}

.filtro-grupo select:focus {
  border-color: #003366;
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.1);
}

/* Oculta elementos com classe .desktop-only em dispositivos móveis (largura <= 768px) */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
}


.btn-call {
    display: inline-block;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.btn-call:hover {
    opacity: 0.8;
}