/* ==========================================================================
   MÓDULO 3: KDS DE COCINA (PANTALLA DE PREPARACIÓN POR TIEMPOS)
   ========================================================================== */

.kds-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 58px);
  background: #06090F;
  overflow: hidden;
}

.kds-header {
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-medium);
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kds-header-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
}
.kds-stats-pills {
  display: flex;
  gap: 10px;
}

.kds-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding: 16px;
  overflow-y: auto;
}

/* Tarjeta de Comanda de Cocina */
.kds-card {
  background: var(--bg-surface);
  border: 2px solid var(--border-medium);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
  transition: border-color var(--transition-fast);
}

.kds-card.time-green {
  border-color: rgba(16, 185, 129, 0.4);
}
.kds-card.time-yellow {
  border-color: rgba(245, 158, 11, 0.6);
  background: linear-gradient(180deg, rgba(245, 158, 11, 0.05), var(--bg-surface));
}
.kds-card.time-red {
  border-color: rgba(239, 68, 68, 0.8);
  background: linear-gradient(180deg, rgba(239, 68, 68, 0.08), var(--bg-surface));
  animation: pulseCardRed 2s infinite;
}

@keyframes pulseCardRed {
  0% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
  50% { box-shadow: 0 0 15px rgba(239, 68, 68, 0.4); }
  100% { box-shadow: 0 0 0 rgba(239, 68, 68, 0); }
}

.kds-card-header {
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kds-table-badge {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.kds-order-num {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}

/* Cronómetro con Semáforo */
.kds-timer-box {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 6px;
}
.kds-timer-box.green {
  background: var(--status-free-bg);
  color: var(--status-free);
  border: 1px solid var(--status-free-border);
}
.kds-timer-box.yellow {
  background: var(--status-occupied-bg);
  color: var(--status-occupied);
  border: 1px solid var(--status-occupied-border);
}
.kds-timer-box.red {
  background: var(--status-alert-bg);
  color: var(--status-alert);
  border: 1px solid var(--status-alert-border);
}

/* Lista de Platos en la Comanda */
.kds-card-items {
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1;
}

.kds-item-row {
  background: var(--bg-surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  transition: background var(--transition-fast);
}
.kds-item-row:hover {
  background: var(--bg-surface-card-hover);
}
.kds-item-row.ready {
  opacity: 0.45;
  text-decoration: line-through;
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.3);
}

.kds-item-qty {
  font-family: var(--font-mono);
  font-size: 16px;
  font-weight: 800;
  color: var(--amber-primary);
  min-width: 28px;
}

.kds-item-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.kds-item-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
}

.kds-item-mods {
  font-size: 12px;
  color: var(--amber-light);
  font-weight: 600;
}

.kds-item-note {
  font-size: 12px;
  font-weight: 800;
  color: #EF4444;
  background: rgba(239, 68, 68, 0.15);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  display: inline-block;
}

.kds-card-footer {
  padding: 12px 16px;
  background: var(--bg-surface-elevated);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  gap: 8px;
}
.kds-pass-all-btn {
  flex: 1;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  border: none;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 13px;
  padding: 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.kds-pass-all-btn:active {
  transform: scale(0.97);
}
