.ocec-app { max-width: 1100px; margin: 20px 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #2b2f3a; }
.ocec-titulo-app { font-size: 20px; font-weight: 800; color: #111827; margin: 0 0 14px; }

/* Filtros */
.ocec-filtros {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: end;
  margin-bottom: 20px; padding: 18px 20px; background: #fff;
  border: 1px solid #e5e7eb; border-radius: 14px; box-shadow: 0 1px 2px rgba(16,24,40,.04);
}
.ocec-campo { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: #555; }
.ocec-campo label {
  font-weight: 700; color: #6b7280; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
.ocec-campo input, .ocec-campo select {
  height: 40px; padding: 0 12px; border: 1px solid #d1d5db; border-radius: 9px;
  font-size: 13.5px; min-width: 170px; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.ocec-campo input:hover, .ocec-campo select:hover { border-color: #9ca3af; }
.ocec-campo input:focus, .ocec-campo select:focus {
  outline: none; border-color: #4f46e5; box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.ocec-campo-btn { justify-content: end; }
.ocec-input-wrap { position: relative; }
.ocec-input-wrap input { padding-left: 34px; }
.ocec-input-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: #9ca3af; pointer-events: none;
}

/* Botones */
.ocec-btn {
  padding: 10px 18px; background: #4f46e5; color: #fff; border: none;
  border-radius: 8px; cursor: pointer; font-size: 13.5px; font-weight: 600;
  transition: background .15s, transform .05s;
}
.ocec-btn:hover { background: #4338ca; }
.ocec-btn:active { transform: scale(0.98); }
.ocec-btn:disabled { background: #d1d5db; color: #9ca3af; cursor: not-allowed; }
.ocec-btn-sm { padding: 7px 14px; font-size: 12.5px; }
.ocec-btn-volver { background: #6b7280; margin-bottom: 16px; }
.ocec-btn-volver:hover { background: #4b5563; }

/* Encabezado de una OC */
.ocec-encabezado { margin-bottom: 16px; }
.ocec-encabezado h3 { font-size: 19px; margin: 0 0 8px; color: #111827; }
.ocec-encabezado-linea { margin: 2px 0; font-size: 14px; color: #4b5563; }
.ocec-encabezado-linea strong { color: #111827; font-weight: 700; margin-right: 4px; }
.ocec-sep { color: #cbd5e1; }

/* Card contenedor de la tabla */
.ocec-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px;
  overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Tabla */
.ocec-tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ocec-tabla thead th {
  background: #f8f9fb; color: #6b7280; font-weight: 700; text-align: left;
  padding: 12px 14px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid #e5e7eb;
}
.ocec-tabla tbody td { padding: 14px; border-bottom: 1px solid #f1f2f4; vertical-align: top; color: #374151; }
.ocec-tabla tbody tr:last-child td { border-bottom: none; }
.ocec-tabla tbody tr:hover { background: #fafbfe; }
.ocec-num { text-align: center; font-variant-numeric: tabular-nums; }
.ocec-col-total { text-align: right !important; }
.ocec-col-renglon { color: #6366f1; font-weight: 700; }
.ocec-col-accion { text-align: right; }
.ocec-col-captura { min-width: 220px; }

/* Badges (estatus / pendiente) */
.ocec-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.ocec-badge-ok { background: #dcfce7; color: #15803d; }
.ocec-badge-pend { background: #fef3c7; color: #b45309; }
.ocec-badge-neutro { background: #f1f2f4; color: #6b7280; }

/* Captura de nueva entrada */
.ocec-captura-row { display: flex; gap: 8px; align-items: center; }
.ocec-input-cantidad { width: 80px; padding: 8px 9px; border: 1px solid #d1d5db; border-radius: 7px; font-size: 13.5px; }
.ocec-input-cantidad:focus { outline: none; border-color: #4f46e5; }
.ocec-input-cantidad:disabled { background: #f3f4f6; }
.ocec-msg-renglon { margin-top: 6px; font-size: 12px; min-height: 16px; }

/* Historial de entradas parciales (número clicable que abre el modal) */
.ocec-link-historial {
  background: #eef0ff; border: none; color: #4338ca; cursor: pointer;
  font-size: 13px; font-weight: 700; padding: 4px 10px; border-radius: 6px;
  min-width: 28px;
}
.ocec-link-historial:hover { background: #e0e3ff; }
.ocec-sin-entradas { color: #cbd5e1; font-size: 12px; }

/* Modal de historial */
.ocec-modal-overlay {
  display: none; position: fixed; inset: 0; background: rgba(15,16,26,.5);
  z-index: 300; align-items: center; justify-content: center; padding: 20px;
}
.ocec-modal-overlay.ocec-modal-open { display: flex; }
.ocec-modal {
  background: #fff; border-radius: 12px; max-width: 520px; width: 100%;
  max-height: 80vh; overflow-y: auto; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.ocec-modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; background: #fff;
}
.ocec-modal-header h4 { margin: 0; font-size: 15px; color: #111827; }
.ocec-modal-cerrar {
  background: none; border: none; font-size: 22px; line-height: 1; color: #9ca3af;
  cursor: pointer; padding: 0 4px;
}
.ocec-modal-cerrar:hover { color: #374151; }
#ocec-modal-body { padding: 8px 20px 20px; }
.ocec-tabla-modal th, .ocec-tabla-modal td { padding: 10px 8px; }
.ocec-btn-borrar { background: #b91c1c; }
.ocec-btn-borrar:hover { background: #991b1b; }

/* Mensajes generales */
.ocec-error { color: #b91c1c; font-weight: 600; }
.ocec-ok { color: #15803d; font-weight: 600; }
.ocec-cargando { color: #6b7280; padding: 20px 0; }
.ocec-vacio { color: #6b7280; font-style: italic; padding: 20px 0; }
.ocec-aviso { padding: 14px 16px; background: #fff7ed; border: 1px solid #fdba74; border-radius: 10px; }

@media (max-width: 720px) {
  .ocec-filtros { flex-direction: column; align-items: stretch; }
  .ocec-campo input, .ocec-campo select { min-width: 0; width: 100%; }
  .ocec-campo-btn { justify-content: stretch; }
  .ocec-tabla, .ocec-tabla thead, .ocec-tabla tbody, .ocec-tabla tr, .ocec-tabla td { display: block; }
  .ocec-tabla thead { display: none; }
  .ocec-tabla tbody tr { border-bottom: 1px solid #e5e7eb; padding: 10px 14px; }
  .ocec-tabla tbody td { border-bottom: none; padding: 4px 0; text-align: left !important; }
  .ocec-historial { justify-content: flex-start; }
  .ocec-captura-row { flex-wrap: wrap; }
}
