/* ==========================================================================
   FaturaMes - Estilos de Tabelas Administrativas
   ========================================================================== */

.table-responsive {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 6px rgba(15, 23, 42, 0.05);
}

/* Custom Scrollbars para Tabelas */
.table-responsive::-webkit-scrollbar {
  height: 8px;
}

.table-responsive::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 0 0 12px 12px;
}

.table-responsive::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.25);
  border: 2px solid #f1f5f9;
  border-radius: 99px;
}

.table-responsive::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.42);
}

/* Estilos de Tabela Gerais */
.table {
  margin-bottom: 0;
  color: var(--fm-ink);
  font-size: 0.875rem;
  line-height: 1.4;
  border-collapse: separate;
  border-spacing: 0;
}

.table > :not(caption) > * > * {
  padding: 13px 16px;
  background: transparent;
  border-bottom: 1px solid rgba(237, 242, 239, .95);
}

/* Cabeçalho da Tabela */
.table thead th {
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
  border-bottom: 1px solid #dde5f0;
}

.table thead th:first-child {
  border-top-left-radius: 8px;
}

.table thead th:last-child {
  border-top-right-radius: 8px;
}

/* Corpo da Tabela */
.table tbody td {
  color: #1e293b;
  font-weight: 500;
  vertical-align: middle;
}

.table tbody tr:nth-child(even) {
  background: rgba(241, 245, 249, .55);
}

/* Formatação Numérica e Datas */
.table tbody td:nth-child(n+6),
.table tbody td.text-end {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Linha da Tabela e Efeitos Hover */
.table tbody tr {
  transition: background-color 0.2s, box-shadow 0.2s;
}

.table tbody tr:hover {
  background-color: rgba(37, 99, 235, .04);
  box-shadow: inset 3px 0 0 #3574d4;
}

.table tbody tr:last-child > * {
  border-bottom: none;
}

/* Badges e Status Pills dentro de Tabelas */
.table .badge,
.table .badge-status,
.table .status-pill {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0;
  padding: 4px 10px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Estilização Premium para Pills de Status com baixa opacidade de fundo */
.table .badge.bg-success,
.table .badge-status.success,
.table .status-pill.success {
  background-color: rgba(39, 201, 63, 0.1) !important;
  color: #0d6b45 !important;
}

.table .badge.bg-warning,
.table .badge-status.warning,
.table .status-pill.warning {
  background-color: rgba(196, 131, 47, 0.1) !important;
  color: #856404 !important;
}

.table .badge.bg-danger,
.table .badge-status.danger,
.table .status-pill.danger {
  background-color: rgba(183, 92, 69, 0.1) !important;
  color: #b75c45 !important;
}

.table .badge.bg-secondary,
.table .badge-status.muted,
.table .status-pill.muted {
  background-color: #eceff1 !important;
  color: #6c757d !important;
}

/* Checkbox */
.table .form-check-input {
  width: 0.95rem;
  height: 0.95rem;
  border-color: #aebdb4;
  border-radius: 4px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.table .form-check-input:checked {
  background-color: var(--fm-primary);
  border-color: var(--fm-primary);
}

/* Botões de Ação na Tabela */
.table .btn-icon-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  font-size: 0.85rem;
  display: inline-grid;
  place-items: center;
  padding: 0;
  transition: transform 0.15s, background-color 0.15s;
}

.table .btn-icon-action:hover {
  transform: scale(1.06);
}

.table .email-status-trigger {
  text-decoration: none;
  line-height: 1;
}

.table .email-status-trigger:hover .badge,
.table .email-status-trigger:focus-visible .badge {
  filter: brightness(0.92);
}

.table-export-toolbar {
  align-items: center;
  padding: 0;
}

.table-export-toolbar .btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border-color: #d5e0da;
  color: #26362f;
  background: rgba(255, 255, 255, .86);
  box-shadow: var(--fm-shadow-line);
}

.table-export-toolbar .btn:hover {
  color: #ffffff;
  background: var(--fm-sidebar-2);
  border-color: var(--fm-sidebar-2);
}

.export-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 5px;
  color: #ffffff;
  font-size: .64rem;
  font-weight: 900;
  line-height: 1;
}

.export-icon-pdf {
  background: var(--fm-coral);
}

.export-icon-excel {
  background: var(--fm-primary);
}

.export-icon-print {
  background: var(--fm-blue);
}

.export-label {
  line-height: 1;
}

@media (max-width: 720px) {
  .table-export-toolbar {
    justify-content: stretch !important;
  }

  .table-export-toolbar .btn {
    flex: 1 1 0;
    justify-content: center;
  }
}
