/* =========================================================================
   PALETA DE CORES E ESTILOS GLOBAIS
   ========================================================================= */
* {
  box-sizing: border-box;
}

body {
  background-color: #dce0de;
  color: #1f2937;
  font-family: "Segoe UI", Arial, sans-serif;
  margin: 0;
  padding: 0;
  line-height: 1.5;
}

/* =========================================================================
   FAIXA SUPERIOR E MENU DE NAVEGAÇÃO
   ========================================================================= */
.top-header {
  background-color: #81f09e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 28px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-container h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.3px;
}

.logo-placeholder {
  background-color: #ffffff;
  border: 1.5px solid #1f2937;
  border-radius: 6px;
  padding: 5px 12px;
  font-weight: bold;
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.nav-horizontal {
  display: flex;
  gap: 10px;
  align-items: center;
}

.nav-link {
  background-color: #ffffff;
  color: #1f2937;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid #374151;
  border-radius: 6px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.nav-link:hover {
  background-color: #f3f4f6;
  transform: translateY(-1px);
}

.nav-sair {
  background-color: #fee2e2;
  border-color: #b91c1c;
  color: #991b1b;
}

.nav-sair:hover {
  background-color: #fecaca;
}

/* =========================================================================
   CONTAINER PRINCIPAL E ALERTAS FLASH
   ========================================================================= */
.container {
  max-width: 960px;
  margin: 28px auto;
  background: #ffffff;
  padding: 28px 32px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.container h2 {
  margin-top: 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e7eb;
  color: #111827;
}

.container h3 {
  margin-top: 22px;
  margin-bottom: 12px;
  color: #374151;
  font-size: 16px;
}

.divisor {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 22px 0;
}

.alerta-flash {
  padding: 12px 16px;
  margin-bottom: 18px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid #9ca3af;
  background-color: #f3f4f6;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.alerta-success {
  background-color: #dcfce7;
  border-color: #16a34a;
  color: #14532d;
}

.alerta-danger {
  background-color: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
}

.alerta-warning {
  background-color: #fef3c7;
  border-color: #d97706;
  color: #78350f;
}

.alerta-info {
  background-color: #e0f2fe;
  border-color: #0284c7;
  color: #0c4a6e;
}

.alerta-duplicados {
  display: none;
  background-color: #fef3c7;
  border: 1px solid #f59e0b;
  padding: 10px 14px;
  margin-top: 6px;
  border-radius: 6px;
  font-size: 13px;
  color: #78350f;
  max-width: 450px;
}

/* =========================================================================
   FORMULÁRIOS E LARGURAS CONTROLADAS EM PX
   ========================================================================= */
.login-wrapper {
  max-width: 380px;
  margin: 10px auto;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: 600;
  font-size: 14px;
  color: #374151;
}

.radio-group {
  display: flex;
  gap: 20px;
  align-items: center;
}

.radio-group label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-bottom: 0;
}

.form-group input[type="text"],
.form-group input[type="password"],
.form-group select {
  padding: 9px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  color: #1f2937;
  background-color: #f9fafb;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus,
.form-group select:focus {
  outline: none;
  background-color: #ffffff;
  border-color: #22c55e;
  box-shadow: 0 0 0 3px rgba(129, 240, 158, 0.35);
}

/* Classes de Largura Específicas (Substituem o CSS inline) */
.input-lg {
  width: 450px;
  max-width: 100%;
}

.input-md-lg {
  width: 380px;
  max-width: 100%;
}

.input-md {
  width: 250px;
  max-width: 100%;
}

.input-sm-md {
  width: 170px;
  max-width: 100%;
}

.input-cep {
  width: 125px;
}

.input-num {
  width: 100px;
}

.input-uf {
  width: 58px;
  text-align: center;
  text-transform: uppercase;
}

/* =========================================================================
   BOTÕES E VARIAÇÕES DE AÇÃO
   ========================================================================= */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.btn-bar-between {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.btn-subgrupo {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

button,
.btn {
  display: inline-block;
  padding: 10px 18px;
  background-color: #81f09e;
  border: 1px solid #1f2937;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
  transition: all 0.15s ease;
}

button:hover,
.btn:hover {
  background-color: #6bd887;
  transform: translateY(-1px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.12);
}

.btn-secondary {
  background-color: #e5e7eb;
  color: #1f2937;
}

.btn-secondary:hover {
  background-color: #d1d5db;
}

.btn-danger {
  background-color: #dc2626;
  color: #ffffff;
  border-color: #991b1b;
}

.btn-danger:hover {
  background-color: #b91c1c;
}

.btn-warning {
  background-color: #facc15;
  color: #111827;
  border-color: #a16207;
}

.btn-warning:hover {
  background-color: #eab308;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 12px;
}

.mt-15 {
  margin-top: 15px;
}

.hidden-form {
  display: none;
}

/* =========================================================================
   TABELA DE RELATÓRIOS
   ========================================================================= */
.tabela-wrapper {
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.tabela-clientes {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tabela-clientes th {
  background-color: #1f2937;
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  padding: 11px 12px;
}

.tabela-clientes td {
  padding: 10px 12px;
  border-bottom: 1px solid #e5e7eb;
  vertical-align: middle;
}

.tabela-clientes tbody tr:nth-child(even) {
  background-color: #f9fafb;
}

.tabela-clientes tbody tr:hover {
  background-color: #ecfdf5;
}

.col-center {
  text-align: center;
}

.col-select {
  width: 60px;
  text-align: center;
}

.col-acoes {
  text-align: center;
  white-space: nowrap;
}

/* =========================================================================
   MODAL POPUP DE VISUALIZAÇÃO
   ========================================================================= */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(17, 24, 39, 0.6);
  backdrop-filter: blur(2px);
}

.modal-content {
  background-color: #ffffff;
  margin: 6% auto;
  padding: 24px 28px;
  border: 1px solid #374151;
  border-radius: 10px;
  width: 620px;
  max-width: 94%;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
  position: relative;
}

.close-btn {
  float: right;
  font-size: 24px;
  font-weight: bold;
  line-height: 1;
  color: #4b5563;
  cursor: pointer;
}

.close-btn:hover {
  color: #111827;
}

/* =========================================================================
   ESTRUTURA DA ETIQUETA PARA IMPRESSÃO A4 (5 LINHAS x 2 COLUNAS = 10/FOLHA)
   ========================================================================= */
.grid-etiquetas {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 8mm;
  row-gap: 4mm;
}

.etiqueta-box {
  border: 1px dashed #374151;
  padding: 4mm 5mm;
  height: 49mm;
  font-size: 12px;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background-color: #ffffff;
  box-sizing: border-box;
  overflow: hidden;
  page-break-inside: avoid;
  break-inside: avoid;
}

.etiqueta-remetente {
  margin: 0 0 4px 0;
}

.etiqueta-divisor {
  border: 0;
  border-top: 0.5px solid #9ca3af;
  margin: 4px 0 6px 0;
}

.etiqueta-linha {
  margin: 0 0 3px 0;
}

.etiqueta-linha-final {
  margin: 0;
}

.etiqueta-cep {
  margin-right: 18px;
  font-weight: 600;
}

/* Página exclusiva de Impressão em Lote */
.body-lote {
  background-color: #ffffff;
  padding: 20px;
}

/* =========================================================================
   CONFIGURAÇÃO PADRÃO DE IMPRESSÃO A4 (5x2)
   ========================================================================= */
@page {
  size: A4 portrait;
  margin: 10mm;
}

@media print {
  body {
    background: #ffffff;
    margin: 0;
    padding: 0;
  }

  .no-print,
  .top-header,
  .btn-group {
    display: none !important;
  }

  .container {
    border: none;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .modal {
    position: static;
    background: none;
    backdrop-filter: none;
  }

  .modal-content {
    border: none;
    box-shadow: none;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: 100%;
  }

  .grid-etiquetas {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 8mm;
    row-gap: 4mm;
  }

  .etiqueta-box {
    border: 1px solid #000000;
    height: 49mm;
  }
}
