/* === MÓDULO DE ÓRDENES DE SERVICIO - ESTILO DOCUMENTO TÉCNICO === */

/* === CONTENEDOR PRINCIPAL === */
.orden-container {
  max-width: 900px;
  margin: 0 auto;
  font-family: 'Segoe UI', system-ui, sans-serif;
}

/* === HEADER TIPO HOJA DE SERVICIO === */
.orden-header {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 1px solid #333;
  padding: 1.5rem 2rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  border-left: 5px solid var(--primary);
  position: relative;
  overflow: hidden;
}

.orden-header::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.03));
  pointer-events: none;
}

.orden-header-info {
  position: relative;
  z-index: 1;
}

.orden-header-info h2 {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.orden-header-info h2::before {
  content: '🔧';
  font-size: 1rem;
}

.orden-header-info .placa {
  font-size: 2.2rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 2px;
  font-family: 'Courier New', monospace;
  background: rgba(255, 215, 0, 0.1);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  display: inline-block;
}

.orden-header-info .fecha {
  color: #888;
  font-size: 0.85rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orden-header-info .fecha::before {
  content: '📅';
  font-size: 0.8rem;
}

.orden-header-estado {
  position: relative;
  z-index: 1;
}

/* === GRID DE INFO (CLIENTE + MOTO) === */
.orden-grid-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 600px) {
  .orden-grid-info {
    grid-template-columns: 1fr;
  }
}

/* === PANELES TIPO FICHA TÉCNICA === */
.orden-panel {
  background: #141414;
  border: 1px solid #2a2a2a;
  padding: 1.25rem;
  border-radius: 6px;
  position: relative;
}

.orden-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 6px 6px 0 0;
}

.orden-panel h4 {
  color: var(--primary);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #2a2a2a;
  font-weight: 600;
}

.orden-panel .info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.orden-panel p {
  margin: 0;
  font-size: 0.9rem;
  color: #ccc;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.orden-panel p strong {
  color: #666;
  font-weight: 500;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* === SECCIONES TIPO LISTADO DE TRABAJO === */
.orden-seccion {
  background: #141414;
  border: 1px solid #2a2a2a;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  position: relative;
}

.orden-seccion::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--primary), #b8860b);
  border-radius: 6px 0 0 6px;
}

.orden-seccion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #2a2a2a;
}

.orden-seccion-header h4 {
  color: #fff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orden-seccion-header h4::before {
  content: '▸';
  color: var(--primary);
}

/* === TABLAS ESTILO TÉCNICO === */
.orden-tabla {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.orden-tabla thead {
  background: #1a1a1a;
}

.orden-tabla th {
  text-align: left;
  padding: 0.6rem 0.75rem;
  color: #888;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--primary);
  font-weight: 600;
}

.orden-tabla th:last-child,
.orden-tabla td:last-child {
  text-align: center;
  width: 50px;
}

.orden-tabla td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid #222;
  vertical-align: middle;
}

.orden-tabla tbody tr {
  transition: background 0.2s;
}

.orden-tabla tbody tr:hover {
  background: rgba(255, 215, 0, 0.05);
}

.orden-tabla tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.02);
}

.orden-tabla input {
  width: 100%;
  padding: 0.5rem 0.6rem;
  background: #0d0d0d;
  border: 1px solid #333;
  color: #fff;
  font-size: 0.85rem;
  border-radius: 3px;
  transition: 0.2s;
}

.orden-tabla input:focus {
  outline: none;
  border-color: var(--primary);
  background: #141414;
}

.orden-tabla input::placeholder {
  color: #555;
}

.orden-tabla input[type="number"] {
  text-align: right;
  font-family: 'Courier New', monospace;
}

.orden-tabla .btn-eliminar {
  background: transparent;
  border: none;
  color: #555;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  transition: 0.2s;
  border-radius: 3px;
}

.orden-tabla .btn-eliminar:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.fila-vacia td {
  text-align: center;
  color: #555;
  font-style: italic;
  padding: 1.5rem !important;
}

/* === SUBTOTAL === */
.subtotal-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.75rem 0;
  margin-top: 0.5rem;
  border-top: 1px dashed #333;
}

.subtotal-row span {
  color: var(--primary);
  font-weight: 700;
  font-size: 1rem;
  margin-left: 1rem;
  font-family: 'Courier New', monospace;
}

/* === BOTÓN AGREGAR FILA === */
.btn-agregar-fila {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem;
  background: transparent;
  border: 1px dashed #444;
  color: #888;
  font-size: 0.75rem;
  cursor: pointer;
  transition: 0.2s;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-agregar-fila:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(255, 215, 0, 0.05);
}

/* === TOTALES ESTILO RESUMEN DE FACTURA === */
.orden-totales {
  background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
  border: 2px solid var(--primary);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}

.orden-totales::before {
  content: 'RESUMEN DE COSTOS';
  position: absolute;
  top: -10px;
  left: 1rem;
  background: var(--primary);
  color: #000;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  padding: 0.25rem 0.75rem;
  border-radius: 3px;
}

.orden-totales h4 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  padding-top: 0.5rem;
}

.totales-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.total-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 4px;
  border: 1px solid #2a2a2a;
}

.total-item label {
  color: #888;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 500;
}

.total-item .valor {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Courier New', monospace;
}

.total-item.total-final {
  background: var(--primary);
  border-color: var(--primary);
  grid-column: 1 / -1;
  justify-content: center;
  gap: 1.5rem;
  padding: 1rem;
}

.total-item.total-final label {
  color: #000;
  font-size: 0.85rem;
  font-weight: 700;
}

.total-item.total-final .valor {
  color: #000;
  font-size: 1.5rem;
}

.total-item.total-final.negative .valor {
  color: #166534;
}

.total-item.abono-negativo .valor {
  color: #22c55e;
}

/* === OBSERVACIONES === */
.orden-observaciones {
  background: #141414;
  border: 1px solid #2a2a2a;
  padding: 1.25rem;
  margin-bottom: 1rem;
  border-radius: 6px;
}

.orden-observaciones h4 {
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orden-observaciones h4::before {
  content: '📝';
}

.orden-observaciones textarea {
  width: 100%;
  min-height: 80px;
  padding: 0.75rem;
  background: #0d0d0d;
  border: 1px solid #333;
  color: #fff;
  font-size: 0.85rem;
  border-radius: 4px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.orden-observaciones textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.orden-observaciones textarea::placeholder {
  color: #555;
}

/* === FIRMA === */
.orden-firma {
  background: #141414;
  border: 1px solid #2a2a2a;
  padding: 1.25rem;
  margin-bottom: 1.5rem;
  border-radius: 6px;
}

.orden-firma h4 {
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.orden-firma h4::before {
  content: '✍️';
}

.firma-box {
  background: #fafafa;
  height: 100px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 0.8rem;
  border: 2px dashed #ccc;
  cursor: pointer;
  transition: 0.2s;
}

.firma-box:hover {
  border-color: var(--primary);
}

.firma-box.signed {
  background: #f5f5f5;
  color: #333;
  border-style: solid;
  border-color: #ddd;
}

/* === BOTONES DE ACCIÓN === */
.orden-acciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  padding: 1.25rem;
  background: #141414;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  margin-top: 1rem;
}

.orden-acciones .btn {
  padding: 0.6rem 1.25rem;
  font-size: 0.8rem;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.2s;
}

.orden-acciones .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* === ESTADOS VISUALES === */
.estado-os {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: 3px;
  background: #222;
  color: #888;
}

.estado-os.recibida { background: #1e3a5f; color: #93c5fd; border: 1px solid #1e40af; }
.estado-os.diagnostico { background: #451a03; color: #fcd34d; border: 1px solid #b45309; }
.estado-os.enReparacion { background: #450a0a; color: #fca5a5; border: 1px solid #dc2626; }
.estado-os.esperando { background: #2e1065; color: #c4b5fd; border: 1px solid #7c3aed; }
.estado-os.terminada { background: #14532d; color: #86efac; border: 1px solid #16a34a; }
.estado-os.entregada { background: #1f2937; color: #9ca3af; border: 1px solid #4b5563; }

/* === SELECTOR DE ESTADO === */
.estado-selector-os {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.estado-selector-os select {
  padding: 0.4rem 0.6rem;
  background: #0d0d0d;
  border: 1px solid #333;
  color: #fff;
  font-size: 0.8rem;
  border-radius: 3px;
  cursor: pointer;
}

.estado-selector-os select:focus {
  outline: none;
  border-color: var(--primary);
}

/* === LISTA DE ÓRDENES === */
.ordenes-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.orden-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  padding: 1rem 1.25rem;
  border-radius: 6px;
  cursor: pointer;
  transition: 0.2s;
  border-left: 3px solid transparent;
}

.orden-card:hover {
  border-color: var(--primary);
  border-left-color: var(--primary);
  background: #1f1f1f;
}

.orden-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.orden-card-num {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.95rem;
  font-family: 'Courier New', monospace;
}

.orden-card-fecha {
  color: #666;
  font-size: 0.8rem;
}

.orden-card-info {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: #888;
}

.orden-card-total {
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2a2a;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.orden-card-total .label {
  color: #666;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.orden-card-total .valor {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  font-family: 'Courier New', monospace;
}

/* === HISTORIAL EN FICHA MOTO === */
.historial-ordenes {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 2px solid #2a2a2a;
}

.historial-ordenes h4 {
  color: #fff;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.historial-ordenes h4::before {
  content: '📋';
}

.orden-resumen {
  background: #0d0d0d;
  border: 1px solid #222;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  cursor: pointer;
  transition: 0.2s;
}

.orden-resumen:hover {
  border-color: var(--primary);
  background: #141414;
}

.orden-resumen .num {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}

.orden-resumen .fecha {
  color: #666;
  font-size: 0.75rem;
}

.orden-resumen .total {
  font-weight: 700;
  color: #fff;
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}

/* === MODAL ORDEN === */
.modal-orden .modal-content {
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  background: #0a0a0a;
}

/* === REPUESTOS TOTAL FILA === */
.repuesto-total {
  font-family: 'Courier New', monospace;
  font-weight: 600;
  color: var(--primary);
}

/* === ABONOS === */
.abono-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0.75rem;
  background: #0d0d0d;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  border: 1px solid #222;
}

.abono-item span:first-child {
  color: var(--primary);
  font-weight: 700;
  font-family: 'Courier New', monospace;
}

.abono-item span:last-child {
  color: #666;
  font-size: 0.75rem;
  margin-left: 1rem;
}

/* === RESPONSIVE MEJORADO === */
@media (max-width: 768px) {
  .orden-header {
    padding: 1rem;
  }
  
  .orden-header-info h2 {
    font-size: 1rem;
  }
  
  .orden-header-info .placa {
    font-size: 1.5rem;
  }
  
  .orden-panel .info-grid {
    grid-template-columns: 1fr;
  }
  
  .orden-tabla th:nth-child(2),
  .orden-tabla td:nth-child(2),
  .orden-tabla th:nth-child(3),
  .orden-tabla td:nth-child(3),
  .orden-tabla th:nth-child(4),
  .orden-tabla td:nth-child(4) {
    display: none;
  }
  
  .orden-tabla th:first-child,
  .orden-tabla td:first-child {
    width: auto;
  }
  
  .orden-acciones {
    flex-direction: column;
  }
  
  .orden-acciones .btn {
    width: 100%;
    text-align: center;
  }
  
  .totales-grid {
    grid-template-columns: 1fr 1fr;
  }
  
  .total-item.total-final {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .orden-container {
    padding: 0.5rem;
  }
  
  .orden-seccion {
    padding: 1rem;
  }
  
  .orden-header-info .placa {
    font-size: 1.25rem;
  }
  
  .orden-panel {
    padding: 1rem;
  }
  
  .totales-grid {
    grid-template-columns: 1fr;
  }
}

/* === PRINT STYLES === */
@media print {
  body * {
    visibility: hidden;
  }
  
  .orden-container,
  .orden-container * {
    visibility: visible;
  }
  
  .orden-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: #fff !important;
    color: #000 !important;
    padding: 1rem;
  }
  
  .orden-header,
  .orden-panel,
  .orden-seccion,
  .orden-totales,
  .orden-observaciones,
  .orden-firma {
    background: #fff !important;
    border: 1px solid #000 !important;
    color: #000 !important;
  }
  
  .orden-header-info h2,
  .orden-panel h4,
  .orden-seccion-header h4 {
    color: #000 !important;
  }
  
  .orden-tabla input {
    border: none;
    background: transparent;
    color: #000 !important;
  }
  
  .btn-agregar-fila,
  .btn-eliminar,
  .orden-acciones,
  .estado-selector-os select {
    display: none !important;
  }
  
  .total-item .valor,
  .subtotal-row span,
  .repuesto-total {
    color: #000 !important;
  }
}
/* === ANIMACIONES DE NOTIFICACIONES === */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

/* === FIRMA DIGITAL === */
.firma-canvas-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.firma-canvas-container canvas {
  width: 100%;
  max-width: 400px;
  height: 150px;
  background: #fff !important;
  border: 2px dashed #444;
  border-radius: 6px;
  cursor: crosshair;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.firma-canvas-container canvas:hover {
  border-color: var(--primary);
}

.firma-botones {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
}

.firma-botones .btn {
  flex: 1;
  max-width: 200px;
}

.firma-ayuda {
  text-align: center;
  color: #666;
  font-size: 0.8rem;
  margin: 0;
}

.firma-preview {
  position: relative;
  background: #fff;
  border: 2px solid #ddd;
  border-radius: 6px;
  padding: 0.5rem;
}

.firma-preview img {
  width: 100%;
  height: 100px;
  object-fit: contain;
}

.btn-limpiar-firma {
  position: absolute;
  top: 5px;
  right: 5px;
  background: rgba(239, 68, 68, 0.9);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-limpiar-firma:hover {
  background: #dc2626;
}

/* === PRIORIDAD === */
.prioridad-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.prioridad-selector label {
  color: #888;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.prioridad-selector select,
.prioridad-selector input[type="datetime-local"] {
  padding: 0.4rem 0.6rem;
  background: #0d0d0d;
  border: 1px solid #333;
  color: #fff;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}

.prioridad-badge {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: 3px;
}

.prioridad-badge.baja { background: #166534; color: #86efac; }
.prioridad-badge.media { background: #854d0e; color: #fde047; }
.prioridad-badge.alta { background: #9a3412; color: #fdba74; }
.prioridad-badge.urgente { background: #991b1b; color: #fca5a5; }

/* ============================================
   PREMIUM MECHANIC PANEL — Enterprise UI
   ============================================ */

/* --- Panel Container --- */
.mec-panel {
  background: linear-gradient(135deg, #141414 0%, #1a1a1a 100%);
  border: 1px solid #2a2a2a;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
}
.mec-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), #f97316, var(--primary));
}

.mec-panel__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid #2a2a2a;
}
.mec-panel__header h4 {
  color: #fff;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}
.mec-panel__icon { font-size: 1rem; }

.mec-panel__btn-assign {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--primary);
  color: var(--primary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  letter-spacing: 0.5px;
}
.mec-panel__btn-assign:hover {
  background: var(--primary);
  color: #000;
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

/* --- Current Mechanic Display --- */
.mec-panel__current {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 1rem;
}
.mec-panel__avatar {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.mec-panel__info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}
.mec-panel__name {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
}
.mec-panel__spec {
  color: #888;
  font-size: 0.8rem;
}
.mec-panel__meta {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  margin-top: 0.25rem;
  flex-wrap: wrap;
}
.mec-panel__estado {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.mec-panel__estado--disponible { background: #14532d; color: #86efac; }
.mec-panel__estado--ocupado { background: #854d0e; color: #fde047; }
.mec-panel__estado--ausente { background: #991b1b; color: #fca5a5; }

.mec-panel__carga {
  font-size: 0.7rem;
  color: #666;
}

/* --- Empty State --- */
.mec-panel__empty {
  text-align: center;
  padding: 2rem;
  color: #666;
}
.mec-panel__empty span { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.mec-panel__empty p { margin-bottom: 1rem; font-size: 0.95rem; }

/* ============================================
   REASSIGNMENT MODAL — Card Grid
   ============================================ */
.mec-modal { background: #0d0d0d; }
.mec-modal__header {
  text-align: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #2a2a2a;
}
.mec-modal__header h2 {
  color: var(--primary);
  font-size: 1.3rem;
  margin-bottom: 0.25rem;
}
.mec-modal__header p { color: #888; font-size: 0.9rem; }

.mec-modal__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.25rem;
}

/* --- Mechanic Cards --- */
.mec-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  background: #1a1a1a;
  border: 2px solid #2a2a2a;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
}
.mec-card:hover {
  border-color: #444;
  background: #1f1f1f;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.mec-card--active {
  border-color: var(--primary) !important;
  background: rgba(255, 215, 0, 0.06) !important;
  box-shadow: 0 0 0 1px var(--primary), 0 6px 20px rgba(255, 215, 0, 0.15) !important;
}
.mec-card--dimmed { opacity: 0.55; }
.mec-card--dimmed:hover { opacity: 0.8; }

.mec-card__avatar {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  flex-shrink: 0;
}
.mec-card__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.mec-card__name {
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mec-card__spec {
  color: #666;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Load bar */
.mec-card__load { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.2rem; }
.mec-card__load-bar {
  flex: 1;
  height: 4px;
  background: #2a2a2a;
  border-radius: 2px;
  overflow: hidden;
}
.mec-card__load-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}
.mec-card__load-text { font-size: 0.6rem; color: #666; white-space: nowrap; }

.mec-card__status { font-size: 0.85rem; flex-shrink: 0; }
.mec-card__check {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: var(--primary);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 900;
}
.mec-empty {
  text-align: center;
  padding: 2rem;
  color: #666;
  grid-column: 1 / -1;
}

/* --- Modal Fields --- */
.mec-modal__fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 500px) {
  .mec-modal__fields { grid-template-columns: 1fr; }
}

/* --- Preview --- */
.mec-modal__preview {
  background: rgba(255, 215, 0, 0.08);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  justify-content: center;
  align-items: center;
}
.mec-modal__preview-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.mec-modal__preview-inner span:first-child {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.95rem;
}

/* --- Modal Actions --- */
.mec-modal__actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

/* ============================================
   PREMIUM TIMELINE — Mechanic History
   ============================================ */
.mtl {
  margin-top: 1rem;
  border-top: 1px solid #2a2a2a;
  padding-top: 1rem;
}
.mtl__header h4 {
  color: #fff;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.mtl__list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.mtl-item {
  display: flex;
  gap: 0.75rem;
  position: relative;
}
.mtl-item__line {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 20px;
  flex-shrink: 0;
  position: relative;
}
.mtl-item__line::after {
  content: '';
  position: absolute;
  top: 14px;
  bottom: -14px;
  width: 2px;
  background: #2a2a2a;
  left: 50%;
  transform: translateX(-50%);
}
.mtl-item:last-child .mtl-item__line::after { display: none; }

.mtl-item__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 3px solid #444;
  background: #0d0d0d;
  z-index: 1;
  flex-shrink: 0;
  margin-top: 4px;
}
.mtl-item--active .mtl-item__dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.4);
}

.mtl-item__body {
  flex: 1;
  padding: 0.6rem 0.75rem;
  background: #141414;
  border: 1px solid #222;
  border-radius: 6px;
  margin-bottom: 0.5rem;
  transition: 0.2s;
}
.mtl-item--active .mtl-item__body {
  border-color: rgba(255, 215, 0, 0.25);
  background: rgba(255, 215, 0, 0.04);
}
.mtl-item__body:hover {
  border-color: #444;
  background: #1a1a1a;
}

.mtl-item__top {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.mtl-item__avatar {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.7rem;
  color: #fff;
  flex-shrink: 0;
}
.mtl-item__info { display: flex; flex-direction: column; flex: 1; }
.mtl-item__name { color: #fff; font-weight: 600; font-size: 0.8rem; }
.mtl-item__action { color: var(--primary); font-size: 0.7rem; font-weight: 500; }

.mtl-item__live {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 0.2rem 0.5rem;
  background: #22c55e;
  color: #fff;
  border-radius: 3px;
  animation: pulse-live 2s infinite;
}
@keyframes pulse-live {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.mtl-item__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.mtl-item__estado {
  font-size: 0.6rem;
  padding: 0.15rem 0.4rem;
  background: #1e1e1e;
  border: 1px solid #333;
  border-radius: 3px;
  color: #aaa;
}
.mtl-item__date { font-size: 0.65rem; color: #555; }
.mtl-item__duration {
  font-size: 0.6rem;
  color: #14b8a6;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  background: rgba(20, 184, 166, 0.1);
  border-radius: 3px;
}
.mtl-item__motivo {
  font-size: 0.6rem;
  color: #888;
  font-style: italic;
}

/* ============================================
   KANBAN — Mechanic Panel
   ============================================ */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
@media (max-width: 900px) { .kanban { grid-template-columns: 1fr; } }

.kanban__col {
  background: #111;
  border: 1px solid #222;
  border-radius: 8px;
  padding: 1rem;
  min-height: 300px;
}
.kanban__col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #222;
}
.kanban__col-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: #888;
}
.kanban__col-count {
  background: #222;
  color: #888;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 10px;
  min-width: 22px;
  text-align: center;
}
.kanban__col--pending .kanban__col-header { border-bottom-color: #f59e0b; }
.kanban__col--pending .kanban__col-count { background: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.kanban__col--progress .kanban__col-header { border-bottom-color: #3b82f6; }
.kanban__col--progress .kanban__col-count { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }
.kanban__col--done .kanban__col-header { border-bottom-color: #22c55e; }
.kanban__col--done .kanban__col-count { background: rgba(34, 197, 94, 0.2); color: #22c55e; }

.kanban__card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  padding: 0.85rem;
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}
.kanban__card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.kanban__card--baja { border-left-color: #22c55e; }
.kanban__card--media { border-left-color: #f59e0b; }
.kanban__card--alta { border-left-color: #f97316; }
.kanban__card--urgente { border-left-color: #ef4444; }

.kanban__card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.kanban__card-placa {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.9rem;
  font-family: 'Courier New', monospace;
}
.kanban__card-pri {
  font-size: 0.55rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}
.kanban__card-pri.baja { background: #14532d; color: #86efac; }
.kanban__card-pri.media { background: #854d0e; color: #fde047; }
.kanban__card-pri.alta { background: #9a3412; color: #fdba74; }
.kanban__card-pri.urgente { background: #991b1b; color: #fca5a5; }

.kanban__card-info { font-size: 0.8rem; color: #888; margin-bottom: 0.25rem; }
.kanban__card-estado {
  display: inline-block;
  font-size: 0.6rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  background: #222;
  color: #aaa;
  margin-top: 0.25rem;
}
.kanban__empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #444;
  font-size: 0.85rem;
}

/* Kanban Quick Action Buttons */
.kanban__card-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid #2a2a2a;
  flex-wrap: wrap;
}

.kanban__action-btn {
  flex: 1;
  min-width: 0;
  padding: 0.35rem 0.5rem;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid #333;
  border-radius: 4px;
  background: #1a1a1a;
  color: #ccc;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  text-align: center;
}

.kanban__action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.kanban__action-btn--diagnostico {
  border-color: #3b82f6;
  color: #93c5fd;
}
.kanban__action-btn--diagnostico:hover {
  background: rgba(59, 130, 246, 0.2);
}

.kanban__action-btn--reparacion {
  border-color: #f59e0b;
  color: #fde047;
}
.kanban__action-btn--reparacion:hover {
  background: rgba(245, 158, 11, 0.2);
}

.kanban__action-btn--esperando {
  border-color: #a78bfa;
  color: #c4b5fd;
}
.kanban__action-btn--esperando:hover {
  background: rgba(167, 139, 250, 0.2);
}

.kanban__action-btn--terminada {
  border-color: #22c55e;
  color: #86efac;
}
.kanban__action-btn--terminada:hover {
  background: rgba(34, 197, 94, 0.2);
}

/* --- Workload Dashboard --- */
.workload-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}
.workload-card {
  background: #1a1a1a;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 1.25rem;
  transition: 0.2s;
}
.workload-card:hover { border-color: #444; }

.workload-card__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.workload-card__avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
  color: #fff;
  flex-shrink: 0;
}
.workload-card__name { color: #fff; font-weight: 600; font-size: 0.95rem; }
.workload-card__spec { color: #666; font-size: 0.75rem; display: block; }

.workload-card__bar {
  height: 6px;
  background: #222;
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.workload-card__bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease;
}
.workload-card__stats {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #666;
}
.workload-card__stats strong { color: #ccc; }

/* --- Workload Order Items --- */
.workload-card__orders {
  margin-top: 0.75rem;
  border-top: 1px solid #2a2a2a;
  padding-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 240px;
  overflow-y: auto;
}
.workload-order {
  padding: 0.5rem 0.65rem;
  background: #111;
  border: 1px solid #222;
  border-radius: 5px;
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.workload-order:hover {
  background: #1a1a1a;
  border-color: #444;
}
.workload-order__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.2rem;
}
.workload-order__placa {
  font-weight: 800;
  color: var(--primary);
  font-size: 0.8rem;
  font-family: 'Courier New', monospace;
}
.workload-order__info {
  display: block;
  font-size: 0.7rem;
  color: #777;
  margin-bottom: 0.2rem;
}
.workload-order__bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.workload-order__time {
  font-size: 0.6rem;
  color: #555;
}
.workload-card__empty {
  text-align: center;
  padding: 1rem;
  color: #444;
  font-size: 0.8rem;
  border-top: 1px solid #222;
  margin-top: 0.75rem;
}
