/**
 * MetalVision - Estilos Centro de Trabajo (Workspace)
 */

/* ============================================
   WORKSPACE CONTAINER
   ============================================ */

.workspace-container {
  width: 100%;
  max-width: none;
}

.workspace-header {
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

/* ============================================
   INBOX (BANDEJA)
   ============================================ */

.inbox-header {
  background: var(--surface);
}

.inbox-stats .badge {
  font-weight: 500;
}

.inbox-list {
  background: var(--bg);
}

/* Base item styles */
.inbox-item {
  cursor: pointer;
  transition: all 0.15s ease;
  background: var(--surface);
  margin-bottom: 2px;
}

.inbox-item:hover {
  background-color: var(--surface-hover);
  transform: translateX(2px);
}

.inbox-item > div {
  padding: 0.875rem 1rem !important;
  border-bottom: none !important;
}

/* Email items - estilos inline por direction */
.inbox-item-email.unread {
  font-weight: 500;
}

/* Task items */
.inbox-item-task {
  background: linear-gradient(to right, rgba(234, 179, 8, 0.05), var(--surface));
  border-left: 3px solid var(--warning);
}

/* Alert items */
.inbox-item-alert {
  border-left-width: 3px !important;
}

.inbox-item-alert > div {
  border-left: none !important;
}

/* Icon alignment */
.inbox-item-icon {
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.inbox-item-icon .avatar-circle {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.inbox-item-icon .form-check {
  margin: 0;
  padding: 0;
  min-height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
}

.inbox-item-icon .form-check-input {
  margin: 0;
  width: 1.25rem;
  height: 1.25rem;
}

/* Content alignment */
.inbox-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.inbox-item-subject {
  font-size: 0.9rem;
  line-height: 1.3;
}

.inbox-item-preview {
  font-size: 0.8rem;
  opacity: 0.7;
  line-height: 1.3;
}

/* Actions */
.inbox-item-actions {
  opacity: 0;
  transition: opacity 0.15s ease;
  display: flex;
  align-items: flex-start;
  padding-top: 2px;
}

.inbox-item:hover .inbox-item-actions {
  opacity: 1;
}

.inbox-footer {
  background: var(--surface);
}

/* ============================================
   PRODUCTION PANEL
   ============================================ */

.production-header {
  background: linear-gradient(135deg, var(--dark) 0%, color-mix(in srgb, var(--dark) 80%, var(--primary)) 100%);
}

.production-grid {
  background: var(--surface);
}

.production-area {
  height: 100%;
}

.area-header .badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.station-card {
  background: var(--surface);
  transition: all 0.15s ease;
}

.station-card:hover {
  background: var(--surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.station-card.border-warning {
  border-width: 2px !important;
}

.avatar-mini {
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
}

/* ============================================
   KPI WIDGETS
   ============================================ */

.kpi-widgets {
  background: var(--surface);
}

.kpi-widget-item {
  transition: all 0.15s ease;
  background: var(--surface);
}

.kpi-widget-item:hover {
  background: var(--surface-hover);
  border-color: var(--primary) !important;
}

.kpi-icon {
  flex-shrink: 0;
}

.kpi-value {
  line-height: 1.2;
}

.kpi-label {
  font-size: 0.75rem;
  line-height: 1.2;
}

.kpi-trend {
  font-weight: 600;
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

.spin i {
  animation: spin 0.5s linear;
}

/* Indicador de actualización en vivo */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.badge .bi-circle-fill {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1199.98px) {
  .inbox-stats {
    display: none !important;
  }
}

@media (max-width: 991.98px) {
  .production-header .d-flex.gap-4 {
    flex-wrap: wrap;
    gap: 0.5rem !important;
  }
  
  .production-header .d-flex.gap-4 span {
    flex: 0 0 auto;
  }
  
  /* En tablets, 2 columnas */
  .workspace-container .col-lg-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .workspace-container .col-lg-3 {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

@media (max-width: 767.98px) {
  /* En móvil, todo a 1 columna */
  .workspace-container .col-lg-6,
  .workspace-container .col-lg-3 {
    flex: 0 0 100%;
    max-width: 100%;
  }
  
  .inbox-list {
    max-height: 350px !important;
    min-height: 250px !important;
  }
  
  .production-grid {
    max-height: 300px !important;
  }
}

/* ============================================
   DARK MODE
   ============================================ */

.dark .inbox-item.unread {
  background-color: color-mix(in srgb, var(--primary) 15%, var(--surface));
}

.dark .station-card {
  border-color: var(--border);
}

.dark .production-header {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}
