/* ===================================
   ESTILOS ESTANDARIZADOS PARA TODOS LOS CRUDS
   =================================== */

/* Card principal del CRUD */
.crud-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

/* Header del card */
.crud-header {
  background: #f8f9fa !important;
  border-bottom: 2px solid #e0e0e0;
  padding: 1rem 1.25rem !important;
}

.crud-title {
  color: #2c3e50;
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
}

.crud-title i {
  color: #fca100;
  font-size: 1.1rem;
}

/* Inputs de búsqueda y filtros */
.crud-search-input,
.crud-filter-select {
  background-color: #ffffff !important;
  border: 2px solid #e0e0e0 !important;
  border-radius: 6px !important;
  color: #2c3e50 !important;
  font-size: 0.95rem !important;
  padding: 0.5rem 0.75rem !important;
  transition: all 0.3s ease !important;
}

.crud-search-input::placeholder {
  color: #95a5a6 !important;
  opacity: 1 !important;
}

.crud-search-input:focus,
.crud-filter-select:focus {
  border-color: #fca100 !important;
  box-shadow: 0 0 0 0.2rem rgba(252, 161, 0, 0.15) !important;
  outline: none !important;
}

/* Body del card */
.crud-body {
  padding: 1.25rem;
  background: #ffffff;
}

/* Tabla */
.crud-table {
  margin-bottom: 0;
  background: #ffffff;
}

.crud-table thead th {
  background: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  color: #495057;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crud-table tbody td {
  padding: 0.75rem;
  vertical-align: middle;
  color: #2c3e50;
  border-top: 1px solid #e9ecef;
}

.crud-table tbody tr {
  transition: background-color 0.2s ease;
}

.crud-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Badges estandarizados */
.crud-badge {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 4px;
}

.crud-badge-success {
  background-color: #28a745;
  color: #ffffff;
}

.crud-badge-danger {
  background-color: #dc3545;
  color: #ffffff;
}

.crud-badge-warning {
  background-color: #ffc107;
  color: #212529;
}

.crud-badge-info {
  background-color: #17a2b8;
  color: #ffffff;
}

.crud-badge-secondary {
  background-color: #6c757d;
  color: #ffffff;
}

.crud-badge-primary {
  background-color: #007bff;
  color: #ffffff;
}

/* Botones de acción estandarizados */
.crud-btn-edit {
  background-color: #ffffff;
  border: 1px solid #007bff;
  color: #007bff;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.crud-btn-edit:hover {
  background-color: #007bff;
  color: #ffffff;
}

.crud-btn-delete {
  background-color: #ffffff;
  border: 1px solid #dc3545;
  color: #dc3545;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.crud-btn-delete:hover {
  background-color: #dc3545;
  color: #ffffff;
}

.crud-btn-view {
  background-color: #ffffff;
  border: 1px solid #28a745;
  color: #28a745;
  padding: 0.375rem 0.75rem;
  border-radius: 4px;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.crud-btn-view:hover {
  background-color: #28a745;
  color: #ffffff;
}

/* Estados de carga */
.crud-loading {
  text-align: center;
  padding: 3rem 0;
}

.crud-spinner {
  color: #fca100;
}

/* Estado vacío */
.crud-empty {
  text-align: center;
  padding: 3rem 0;
}

.crud-empty-icon {
  color: #6c757d;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.crud-empty-text {
  color: #6c757d;
  font-size: 1rem;
}

/* Imágenes en tablas */
.crud-img-thumbnail {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid #e0e0e0;
}

/* Texto truncado */
.crud-text-truncate {
  display: block;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Estilos para vista compacta de productos */
.producto-compact {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.producto-compact-img {
  width: 45px;
  height: 45px;
  border-radius: 6px;
  object-fit: cover;
  border: 2px solid #e0e0e0;
  flex-shrink: 0;
}

.producto-compact-info {
  flex: 1;
  min-width: 0;
}

.producto-compact-name {
  color: #2c3e50;
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.2;
  margin-bottom: 2px;
  display: block;
}

.producto-compact-desc {
  color: #6c757d;
  font-size: 0.75rem;
  line-height: 1.3;
  margin-bottom: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
}

.producto-ingredients {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  margin-top: 3px;
}

.ingredient-mini {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #e8f4f8;
  color: #0277bd;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}

.ingredient-mini.alergeno {
  background: #ffebee;
  color: #c62828;
}

.ingredient-mini i {
  font-size: 0.65rem;
}

/* Tabla más compacta */
.crud-table-compact tbody td {
  padding: 0.5rem 0.6rem !important;
  font-size: 0.85rem;
}

.crud-table-compact thead th {
  padding: 0.6rem 0.6rem !important;
  font-size: 0.82rem;
}

.crud-badge-compact {
  font-size: 0.7rem !important;
  padding: 2px 7px !important;
  line-height: 1.3 !important;
}

.crud-btn-compact {
  padding: 4px 8px !important;
  font-size: 0.8rem !important;
}

/* Precio compacto */
.precio-compact {
  color: #28a745;
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
  .crud-header {
    padding: 0.75rem !important;
  }
  
  .crud-title {
    font-size: 1rem;
  }
  
  .crud-table thead th {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
  
  .crud-table tbody td {
    font-size: 0.85rem;
    padding: 0.5rem;
  }
  
  .producto-compact-img {
    width: 35px;
    height: 35px;
  }
}
