.modal-content {
  max-height: 85vh;
  overflow-y: auto;
  padding: 1rem;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 10px;
  border-bottom: 1px solid #ddd;
  background: white;
  color: #333;
  border-radius: 8px 8px 0 0;
}

.header-right {
  display: flex;
  gap: 8px;
  align-items: center;
}

.header-container-title {
  flex-grow: 1;
  text-align: left;
  margin-left: 1em;
}

.header-container-title h2 {
  margin: 0;
  font-weight: 500;
}

.header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.action-button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid #ddd;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
  background: white;
  color: #333;
}

.action-button:hover {
  background: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-button.secondary {
  background: #f8f9fa;
  border-color: #adb5bd;
}

.action-button.secondary:hover {
  background: #e9ecef;
}

/* Estadísticas */
.stats-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 15px;
  margin: 20px 0;
  padding: 0 10px;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border-left: 4px solid #667eea;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: #667eea;
  margin-bottom: 5px;
}

.stat-label {
  font-size: 0.9rem;
  color: #666;
  font-weight: 500;
}

/* Filtros mejorados */
.filters-section {
  background: #f8f9fa;
  border-radius: 8px;
  margin: 20px 0;
  padding: 20px;
  border: 1px solid #e9ecef;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.filters-header h3 {
  margin: 0;
  color: #495057;
  font-weight: 500;
}

.search-container {
  display: flex;
  flex-direction: row;
  gap: 15px;
  transition: all 0.3s ease;
  margin: 1.5rem 0rem 0.5rem 0rem;
  box-sizing: border-box;
  align-items: center;
  justify-content: space-between;
}

.search-container.expanded {
  gap: 20px;
}

.filter-row {
  display: flex;
  gap: 15px;
  align-items: center;
  width: 100%;
}

.advanced-filters {
  border-top: 1px solid #dee2e6;
  padding-top: 15px;
  margin-top: 10px;
}

.calendar-button-row {
  display: flex;
  gap: 15px;
}

.lists-container {
  padding: 16px;
}

.imagesLists-container {
  flex: 1;
}

.card.unidad-card {
  height: 100%;
  box-sizing: border-box;
}

table {
  width: 100%;
}

.search-string {
  flex: 1;
  padding: 5px;
}

.search-boolean {
  flex: 1;
  padding: 5px;
}

.search-select {
  flex: 2;
  padding: 5px;
}

.search-date {
  flex: 1;
  padding: 5px;
}

.mat-elevation-z8 {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
}

/* Tabla mejorada */
.table-container {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.table-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #dee2e6;
}

.table-info {
  color: #6c757d;
  font-size: 0.9rem;
}

.table-actions {
  display: flex;
  gap: 10px;
}

.column-header {
  display: flex;
  align-items: center;
  gap: 5px;
}

.sort-button {
  opacity: 0.5;
  transition: opacity 0.3s ease;
}

.sort-button:hover {
  opacity: 1;
}

.sort-button.active {
  opacity: 1;
  color: #667eea;
}

/* Celdas mejoradas */
.command-cell, .client-cell, .date-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.command-name, .client-name {
  font-weight: 500;
  color: #212529;
}

.command-id, .client-ip {
  font-size: 0.75rem;
  color: #6c757d;
}

.date-time {
  font-size: 0.85rem;
  color: #212529;
}

.date-relative {
  font-size: 0.7rem;
  color: #6c757d;
  font-style: italic;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: #667eea;
  min-width: 35px;
}

/* Ajuste para el botón de cancelar en la barra de progreso */
.progress-container .cancel-button {
  margin-left: auto;
  flex-shrink: 0;
}

.paginator-container {
  display: flex;
  justify-content: end;
  margin: 20px 0;
  padding: 0 10px;
}

/* Chips de estado mejorados */
.chip-failed {
  background-color: #ff6b6b !important;
  color: white !important;
  font-weight: 500;
}

.chip-success {
  background-color: #51cf66 !important;
  color: white !important;
  font-weight: 500;
}

.chip-pending {
  background-color: #74c0fc !important;
  color: white !important;
  font-weight: 500;
}

.chip-in-progress {
  background-color: #ffd43b !important;
  color: #212529 !important;
  font-weight: 500;
}

.chip-cancelled {
  background-color: #adb5bd !important;
  color: white !important;
  font-weight: 500;
}

.chip-sent {
  background-color: #b19cd9 !important;
  color: white !important;
  font-weight: 500;
}

.status-progress-flex {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Opciones de estado */
.status-option {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.status-indicator.failed { background-color: #dc3545; }
.status-indicator.success { background-color: #28a745; }
.status-indicator.pending { background-color: #17a2b8; }
.status-indicator.in-progress { background-color: #ffc107; }
.status-indicator.cancelled { background-color: #6c757d; }
.status-indicator.sent { background-color: #b19cd9; }

/* Opciones de cliente */
.client-option {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.client-name {
  font-weight: 500;
}

.client-details {
  font-size: 0.8rem;
  color: #6c757d;
}

/* Botones de acción */
.action-buttons {
  display: flex;
  gap: 5px;
  justify-content: center;
}

button.cancel-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px;
}

.cancel-button {
  color: #dc3545;
  background-color: transparent;
  border: none;
  padding: 0;
  transition: all 0.3s ease;
}

.cancel-button:hover {
  background-color: rgba(220, 53, 69, 0.1);
  border-radius: 50%;
}

.cancel-button mat-icon {
  color: #dc3545;
}

/* Filas seleccionadas */
.selected-row {
  background-color: rgba(102, 126, 234, 0.1) !important;
}

.mat-row:hover {
  background-color: rgba(102, 126, 234, 0.05);
  cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    background: white;
    color: #333;
  }
  
  .header-actions {
    width: 100%;
    justify-content: center;
  }
  
  .stats-container {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .filter-row {
    grid-template-columns: 1fr;
  }
  
  .table-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .action-buttons {
    flex-direction: column;
    gap: 2px;
  }
}

/* Animaciones */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-container, .filters-section, .table-container {
  animation: fadeIn 0.5s ease-out;
}

/* Estados de carga */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

/* Botón de cerrar en footer */
.footer-actions {
  display: flex;
  justify-content: flex-end;
  padding: 20px 0;
  border-top: 1px solid #e9ecef;
  margin-top: 20px;
}

.footer-actions button {
  min-width: 120px;
  padding: 10px 24px;
  font-weight: 500;
  border-radius: 8px;
  transition: all 0.3s ease;
  background-color: white;
  color: #333;
  border: 1px solid #ddd;
}

.footer-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  background-color: #f8f9fa;
}

.action-container {
  display: flex;
  justify-content: flex-end;
  gap: 1em;
  padding: 1.5em;
}
