/* ==========================================================================
   COTIZADOR AUTOMÁTICO - Componentes UI Auxiliares
   ========================================================================== */

/* ==========================================================================
   Estructura de Tarjetas Secundarias
   ========================================================================== */

.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--foreground);
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-title svg, .card-title i {
  width: 20px;
  height: 20px;
  color: var(--primary);
}

.card-actions {
  display: flex;
  gap: 8px;
}

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--muted);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ==========================================================================
   Variantes de Botones Auxiliares
   ========================================================================== */

.btn-secondary {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--border);
  transform: translateY(-1px);
}

.btn-destructive {
  background: var(--destructive);
  color: white;
  border-color: var(--destructive);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.btn-destructive:hover {
  background: var(--destructive-hover);
  border-color: var(--destructive-hover);
  transform: translateY(-1px);
}

.btn-success {
  background: var(--success);
  color: white;
  border-color: var(--success);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.825rem;
  border-radius: var(--radius-sm);
}

.btn-sm svg, .btn-sm i {
  width: 14px;
  height: 14px;
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1.05rem;
  border-radius: var(--radius-lg);
}

.btn-icon {
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--muted-foreground);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background: var(--muted);
  color: var(--foreground);
}

.btn-icon.btn-delete:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--destructive);
}

/* ==========================================================================
   Grupos de Formulario
   ========================================================================== */

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--foreground);
}

.form-label-muted {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   Tablas Auxiliares (Data Table Genérica)
   ========================================================================== */

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  background: var(--muted);
  padding: 12px 16px;
  text-align: left;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background: var(--purple-50);
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(139, 92, 246, 0.1);
}

.data-table .col-actions { width: 60px; text-align: center; }
.data-table .col-narrow { width: 100px; }
.data-table .col-medium { width: 160px; }
.data-table .col-wide { width: 220px; }

/* ==========================================================================
   Tarjetas KPI
   ========================================================================== */

.kpi-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-sm);
}

.kpi-unit {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted-foreground);
  margin-left: 4px;
}

.kpi-success {
  background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
  color: white;
  border: none;
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
}

/* ==========================================================================
   Badges y Etiquetas
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-default { background: var(--secondary); color: var(--secondary-foreground); }
.badge-primary { background: rgba(139, 92, 246, 0.15); color: var(--primary); }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.15); color: #d97706; }
.badge-destructive { background: rgba(239, 68, 68, 0.15); color: var(--destructive); }

/* ==========================================================================
   Estados Vacíos (Empty State)
   ========================================================================== */

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

.empty-state svg, .empty-state i {
  width: 56px;
  height: 56px;
  color: var(--muted-foreground);
  margin-bottom: 16px;
  opacity: 0.5;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.9rem;
  color: var(--muted-foreground);
  max-width: 360px;
}

/* ==========================================================================
   Utilidades Rrápidas
   ========================================================================== */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }

.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--muted-foreground); }
.text-right { text-align: right; }
.font-mono { font-family: var(--font-mono); }
.font-semibold { font-weight: 600; }
