/* ============================================================
   BBJ Flow — Módulo Financeiro
   ============================================================ */

/* ========================================
   KPI Cards (Dashboard)
   ======================================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.kpi-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  transition: box-shadow var(--transition-fast), transform var(--transition-fast), background var(--transition-fast);
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.97);
}

.kpi-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.kpi-icon .material-symbols-outlined {
  font-size: 24px;
}

.kpi-icon-verde {
  background-color: var(--color-farol-verde-bg);
  color: var(--color-farol-verde);
}

.kpi-icon-amber {
  background-color: var(--color-farol-amber-bg);
  color: var(--color-farol-amber);
}

.kpi-icon-red {
  background-color: var(--color-farol-red-bg);
  color: var(--color-farol-red);
}

.kpi-icon-blue {
  background-color: #e3f2fd;
  color: #1565c0;
}

.kpi-content {
  flex: 1;
  min-width: 0;
}

.kpi-label {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: var(--font-weight-medium);
  margin-bottom: var(--space-xs);
}

.kpi-value {
  font-family: var(--font-mono);
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-black);
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.kpi-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.kpi-badge-verde {
  background-color: var(--color-farol-verde-bg);
  color: var(--color-farol-verde-text);
}

.kpi-badge-amber {
  background-color: var(--color-farol-amber-bg);
  color: var(--color-farol-amber-text);
}

.kpi-badge-red {
  background-color: var(--color-farol-red-bg);
  color: var(--color-farol-red-text);
}

.kpi-badge-blue {
  background-color: #e3f2fd;
  color: #0d47a1;
}

/* ========================================
   Gráfico
   ======================================== */
.chart-container {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.chart-header h3 {
  margin-bottom: 0;
  font-size: var(--text-md);
}

.chart-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}

/* ========================================
   Sub-navegação (Tabs)
   ======================================== */
.subnav-tabs {
  display: flex;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-gray-100);
  padding-bottom: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.subnav-tab {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-500);
  border-bottom: 2px solid transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  min-height: var(--touch-target);
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  margin-bottom: -1px;
}

.subnav-tab:hover {
  color: var(--color-gray-800);
  border-bottom-color: var(--color-gray-300);
}

.subnav-tab.active {
  color: var(--color-black);
  border-bottom-color: var(--color-black);
}

.subnav-tab .material-symbols-outlined {
  font-size: 18px;
}

/* ========================================
   Tabela de Inadimplentes
   ======================================== */
.inadimplentes-section {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: var(--space-lg);
}

.inadimplentes-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.inadimplentes-section .section-header h3 {
  margin-bottom: 0;
  font-size: var(--text-md);
}

.status-dias {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
}

.status-dias.alerta {
  color: var(--color-farol-red);
}

.status-dias.atencao {
  color: var(--color-farol-amber);
}

.status-dias.ok {
  color: var(--color-farol-verde);
}

/* ========================================
   Modal de Plano
   ======================================== */
.toggle-group {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: var(--touch-target);
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  background-color: var(--color-gray-300);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: background-color var(--transition-fast);
  flex-shrink: 0;
}

.toggle-switch.active {
  background-color: var(--color-farol-verde);
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background-color: white;
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: var(--shadow-sm);
}

.toggle-switch.active::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: var(--text-sm);
  color: var(--color-gray-700);
}

/* ========================================
   Autocomplete (Pagamento Modal)
   ======================================== */
.autocomplete-container {
  position: relative;
}

.autocomplete-container .form-input {
  padding-right: 40px;
}

.autocomplete-container .autocomplete-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-gray-400);
  cursor: pointer;
  padding: 4px;
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.autocomplete-container .autocomplete-clear:hover {
  background-color: var(--color-gray-100);
  color: var(--color-gray-700);
}

/* ========================================
   Relatórios
   ======================================== */
.relatorio-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.relatorio-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  transition: box-shadow var(--transition-fast), background var(--transition-fast);
}

.relatorio-card:hover {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, 0.97);
}

.relatorio-card-header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}

.relatorio-card-header .relatorio-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--color-gray-50);
  color: var(--color-gray-600);
  flex-shrink: 0;
}

.relatorio-card-header .relatorio-card-icon .material-symbols-outlined {
  font-size: 22px;
}

.relatorio-card-info h4 {
  font-size: var(--text-sm);
  margin-bottom: 2px;
}

.relatorio-card-info p {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  margin: 0;
}

.relatorio-card-actions {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-end;
  flex-wrap: wrap;
}

.relatorio-card-actions .form-select,
.relatorio-card-actions .form-input {
  min-width: 100px;
}

.relatorio-preview {
  background: var(--color-white-pure);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: var(--space-lg);
}

.relatorio-preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.relatorio-preview-header h4 {
  margin-bottom: 0;
  font-size: var(--text-sm);
}

.relatorio-preview-header .preview-count {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  font-family: var(--font-mono);
}

/* ========================================
   Alertas Panel
   ======================================== */
.alertas-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 380px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-xl);
  z-index: calc(var(--z-modal) + 1);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.25s ease;
}

.alertas-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  border-bottom: 1px solid var(--color-gray-100);
  min-height: var(--header-height);
}

.alertas-panel-header h3 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: var(--text-md);
  margin-bottom: 0;
}

.alertas-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md);
}

.alertas-panel-footer {
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--color-gray-100);
}

.alerta-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background-color: var(--color-gray-50);
  margin-bottom: var(--space-sm);
  transition: background-color var(--transition-fast);
}

.alerta-item.resolvido {
  opacity: 0.5;
}

.alerta-item .alerta-icon {
  color: var(--color-farol-red);
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.alerta-item .alerta-info {
  flex: 1;
  min-width: 0;
}

.alerta-item .alerta-nome {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-900);
}

.alerta-item .alerta-detalhe {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  margin-top: 2px;
}

.alerta-item .alerta-actions {
  flex-shrink: 0;
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

/* ========================================
   Modais de Gráfico (Financeiro KPIs)
   ======================================== */
.financeiro-modal-chart {
  background: var(--color-white-pure);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  margin: var(--space-md);
}

.financeiro-modal-chart .chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.financeiro-modal-chart .chart-header h3 {
  margin-bottom: 0;
  font-size: var(--text-md);
  font-weight: var(--font-weight-semibold);
}

.financeiro-modal-chart .chart-wrapper {
  position: relative;
  height: 300px;
  width: 100%;
}

/* ========================================
   Badge de Alerta no Sidebar / Header
   ======================================== */
.alert-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  color: white;
  background-color: var(--color-farol-red);
  border-radius: var(--radius-full);
  line-height: 1;
}

.alert-badge-sm {
  min-width: 16px;
  height: 16px;
  font-size: 10px;
  padding: 0 4px;
}

/* ========================================
   Overlay do Alertas Panel
   ======================================== */
.alertas-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.4);
  z-index: var(--z-modal);
  animation: fadeIn 0.2s ease;
}

/* ========================================
   Status Badge (Pagamentos)
   ======================================== */
.badge-estornado {
  background-color: var(--color-farol-cinza-bg);
  color: var(--color-farol-cinza-text);
}

.badge-estornado .badge-dot {
  background-color: var(--color-farol-cinza);
}

.badge-normal {
  background-color: var(--color-farol-verde-bg);
  color: var(--color-farol-verde-text);
}

.badge-normal .badge-dot {
  background-color: var(--color-farol-verde);
}

/* ========================================
   Boleto Status Badges
   ======================================== */
.boleto-status-pending {
  color: var(--color-farol-verde);
}

.boleto-status-paid {
  color: var(--color-farol-verde-text);
}

.boleto-status-expired {
  color: var(--color-farol-red);
}

.boleto-status-cancelled {
  color: var(--color-gray-400);
}

/* Full badge variant (background + dot) */
.badge-boleto-pending {
  background-color: var(--color-farol-verde-bg);
  color: var(--color-farol-verde-text);
}
.badge-boleto-pending .badge-dot {
  background-color: var(--color-farol-verde);
}

.badge-boleto-paid {
  background-color: var(--color-farol-verde-bg);
  color: var(--color-farol-verde-text);
}
.badge-boleto-paid .badge-dot {
  background-color: var(--color-farol-verde);
}

.badge-boleto-expired {
  background-color: var(--color-farol-red-bg);
  color: var(--color-farol-red-text);
}
.badge-boleto-expired .badge-dot {
  background-color: var(--color-farol-red);
}

.badge-boleto-cancelled {
  background-color: var(--color-farol-cinza-bg);
  color: var(--color-farol-cinza-text);
}
.badge-boleto-cancelled .badge-dot {
  background-color: var(--color-farol-cinza);
}

/* ========================================
   Boleto — Resultado de Sucesso (Pós-Emissão)
   ======================================== */
.boleto-resultado {
  text-align: center;
  padding: 2rem;
}

.boleto-resultado .boleto-icon {
  font-size: 48px;
  margin-bottom: 1rem;
}

.boleto-resultado .boleto-info {
  text-align: left;
  max-width: 400px;
  margin: 1.5rem auto;
}

.boleto-resultado .boleto-info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--color-gray-200);
}

.boleto-resultado .boleto-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  margin-top: 1.5rem;
}

/* ========================================
   Boleto — Página (Lista, Empty State)
   ======================================== */
.boleto-card {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  border-radius: var(--radius-lg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  padding: var(--space-lg);
}

.boleto-card .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.boleto-card .section-header h3 {
  margin-bottom: 0;
  font-size: var(--text-md);
}

.boleto-empty-icon {
  font-size: 64px;
  color: var(--color-gray-300);
  margin-bottom: var(--space-md);
}

/* Tooltip para link do boleto (truncado) */
.boleto-link-cell {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  display: inline-block;
  vertical-align: middle;
}

/* Status text labels (inline, sem badge) */
.boleto-label-pending {
  color: var(--color-farol-verde);
  font-weight: var(--font-weight-medium);
}

.boleto-label-paid {
  color: var(--color-farol-verde-text);
  font-weight: var(--font-weight-medium);
}

.boleto-label-expired {
  color: var(--color-farol-red);
  font-weight: var(--font-weight-medium);
}

.boleto-label-cancelled {
  color: var(--color-gray-400);
  font-weight: var(--font-weight-medium);
}

/* ========================================
   Boleto — Result Card (Modal)
   ======================================== */
.boleto-result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-lg);
  padding: var(--space-xl) var(--space-lg);
}

.boleto-result-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}

.boleto-result-info {
  width: 100%;
  max-width: 480px;
  background: var(--color-gray-50);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.boleto-result-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) 0;
  gap: var(--space-md);
}

.boleto-result-label {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  font-weight: var(--font-weight-medium);
  flex-shrink: 0;
}

.boleto-result-value {
  font-size: var(--text-sm);
  color: var(--color-gray-900);
  font-weight: var(--font-weight-medium);
  text-align: right;
  word-break: break-all;
}

.boleto-result-valor {
  font-family: var(--font-mono);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-black);
}

.boleto-result-mono {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--color-gray-800);
  text-align: right;
  word-break: break-all;
  letter-spacing: 0.5px;
}

.boleto-result-divider {
  height: 1px;
  background-color: var(--color-gray-200);
  margin: var(--space-sm) 0;
}

/* ========================================
   Responsivo
   ======================================== */

/* Tablet (769-1024px) */
@media (max-width: 1024px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .relatorio-cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .alertas-panel {
    width: 340px;
  }

  .boleto-resultado {
    padding: var(--space-xl);
  }
}

/* Mobile (≤768px) */
@media (max-width: 768px) {
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
  }

  .kpi-card {
    padding: var(--space-md);
  }

  .kpi-icon {
    width: 40px;
    height: 40px;
  }

  .kpi-icon .material-symbols-outlined {
    font-size: 20px;
  }

  .kpi-value {
    font-size: var(--text-xl);
  }

  .chart-wrapper {
    height: 220px;
  }

  .subnav-tabs {
    gap: 0;
    margin: 0 calc(-1 * var(--space-md)) var(--space-md);
    padding: 0 var(--space-md);
  }

  .subnav-tab {
    padding: var(--space-sm) var(--space-sm);
    font-size: var(--text-xs);
  }

  .relatorio-cards {
    grid-template-columns: 1fr;
  }

  .alertas-panel {
    width: 100%;
    max-width: 100%;
  }

  .relatorio-card-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .relatorio-card-actions .form-select,
  .relatorio-card-actions .form-input {
    min-width: 0;
    width: 100%;
  }

  /* Responsive table for inadimplentes */
  .table-financeiro thead {
    display: none;
  }

  .table-financeiro tbody tr {
    display: block;
    padding: var(--space-md);
    border-bottom: 1px solid var(--color-gray-100);
  }

  .table-financeiro td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xs) 0;
    border-bottom: none;
    gap: var(--space-sm);
  }

  .table-financeiro td::before {
    content: attr(data-label);
    font-size: var(--text-xs);
    color: var(--color-gray-400);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    font-weight: var(--font-weight-medium);
  }

  .table-financeiro td:last-child {
    padding-top: var(--space-sm);
    border-top: 1px solid var(--color-gray-100);
    margin-top: var(--space-sm);
  }

  .inadimplentes-section .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-sm);
  }

  /* Boleto - resultado mobile */
  .boleto-resultado {
    padding: var(--space-lg) var(--space-md);
  }

  .boleto-resultado .boleto-icon {
    font-size: 40px;
  }

  .boleto-resultado .boleto-info {
    max-width: 100%;
  }

  .boleto-resultado .boleto-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .boleto-resultado .boleto-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .boleto-link-cell {
    max-width: 100px;
  }
}

/* ========================================
   Autocomplete — Modal Lote
   ======================================== */
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  background: var(--color-white-pure);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  max-height: 240px;
  overflow-y: auto;
  margin-top: 2px;
}

.autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  gap: var(--space-sm);
}

.autocomplete-item:hover,
.autocomplete-item:focus {
  background-color: var(--color-gray-50);
}

.autocomplete-item-name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-900);
}

.autocomplete-item-plano {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
  white-space: nowrap;
}

.autocomplete-loading {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: var(--text-xs);
  color: var(--color-gray-400);
}

/* ========================================
   Selected List — Modal Lote
   ======================================== */
.selected-list {
  margin-top: var(--space-lg);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--color-gray-50);
}

.selected-list-title {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-700);
  margin-bottom: var(--space-sm);
}

.selected-list-count {
  font-weight: var(--font-weight-normal);
  color: var(--color-gray-400);
}

.selected-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-sm);
  margin-bottom: var(--space-xs);
  background: var(--color-white-pure);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-gray-100);
  gap: var(--space-sm);
}

.selected-item:last-child {
  margin-bottom: 0;
}

.selected-item-info {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}

.selected-item-name {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-gray-900);
}

.selected-item-plano {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
}

.selected-item-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  color: var(--color-gray-400);
  transition: all var(--transition-fast);
  flex-shrink: 0;
}

.selected-item-remove:hover {
  background-color: var(--color-farol-red-bg);
  color: var(--color-farol-red);
}

/* Badge info para famílias */
.badge-info {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-full);
  background-color: #e3f2fd;
  color: #1565c0;
}

/* ========================================
   Result Box — Modal Lote / Mês
   ======================================== */
.result-box {
  margin-top: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.result-success {
  background-color: var(--color-farol-verde-bg);
  border: 1px solid #c8e6c9;
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-sm);
}

.result-success h4 {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-farol-verde-text);
  margin-bottom: var(--space-sm);
}

.result-errors {
  background-color: var(--color-farol-red-bg);
  border: 1px solid #ffcdd2;
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.result-errors h4 {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-farol-red-text);
  margin-bottom: var(--space-sm);
}

.result-item {
  font-size: var(--text-sm);
  color: var(--color-gray-700);
  margin: 2px 0;
  padding: 2px 0;
}

/* ========================================
   Validação Resumo — Modal Mês
   ======================================== */
.validacao-resumo {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--color-white-pure);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
}

.validacao-title {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-gray-700);
  margin-bottom: var(--space-md);
}

.validacao-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.validacao-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-gray-50);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--color-gray-300);
}

.validacao-item-success {
  border-left-color: var(--color-farol-verde);
}

.validacao-item-warning {
  border-left-color: var(--color-farol-amber);
}

.validacao-item-info {
  border-left-color: #1565c0;
}

.validacao-label {
  font-size: var(--text-xs);
  color: var(--color-gray-400);
}

.validacao-value {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-gray-900);
}

/* ========================================
   Alert Warning
   ======================================== */
.alert-warning {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background-color: var(--color-farol-amber-bg);
  border: 1px solid #ffe0b2;
  border-radius: var(--radius-md);
  color: var(--color-farol-amber-text);
  font-size: var(--text-sm);
  margin-bottom: var(--space-sm);
}

/* ========================================
   Spinner pequeno
   ======================================== */
.spinner-sm {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-gray-200);
  border-top-color: var(--color-gray-600);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

/* ========================================
   Responsivo — Modais Lote / Mês
   ======================================== */
@media (max-width: 768px) {
  .validacao-grid {
    grid-template-columns: 1fr;
  }

  .form-row[style*="display: flex"] {
    flex-direction: column;
  }

  .autocomplete-list {
    max-height: 180px;
  }
}
